Skip to content

Commit 71b4a85

Browse files
committed
[DependencyInjection] adjust Autowire attribute implementation
1 parent 8ce7016 commit 71b4a85

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,14 @@ public function testAutowireAttribute()
467467

468468
$locator = $container->get($locatorId)->get('foo::fooAction');
469469

470+
$this->assertCount(7, $locator->getProvidedServices());
470471
$this->assertInstanceOf(\stdClass::class, $locator->get('service1'));
471472
$this->assertSame('foo/bar', $locator->get('value'));
472473
$this->assertSame('foo', $locator->get('expression'));
474+
$this->assertInstanceOf(\stdClass::class, $locator->get('serviceAsValue'));
475+
$this->assertInstanceOf(\stdClass::class, $locator->get('expressionAsValue'));
476+
$this->assertSame('bar', $locator->get('rawValue'));
477+
$this->assertSame('@bar', $locator->get('escapedRawValue'));
473478
$this->assertFalse($locator->has('service2'));
474479
}
475480
}
@@ -562,6 +567,14 @@ public function fooAction(
562567
string $value,
563568
#[Autowire(expression: "parameter('some.parameter')")]
564569
string $expression,
570+
#[Autowire('@some.id')]
571+
\stdClass $serviceAsValue,
572+
#[Autowire("@=service('some.id')")]
573+
\stdClass $expressionAsValue,
574+
#[Autowire('bar')]
575+
string $rawValue,
576+
#[Autowire('@@bar')]
577+
string $escapedRawValue,
565578
#[Autowire(service: 'invalid.id')]
566579
\stdClass $service2 = null,
567580
) {

0 commit comments

Comments
 (0)