Skip to content

Commit 0ae5e54

Browse files
committed
Adding failing test for aliases
1 parent 5051ec0 commit 0ae5e54

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Tests/Fixtures/Entities/Contact.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ public function getName(): string
3737
* @Field()
3838
* @Autowire(for="$testService")
3939
* @Autowire(for="$someService", identifier="someService")
40+
* @Autowire(for="$someService", identifier="someAlias")
4041
* @return string
4142
*/
42-
public function injectService(TestGraphqlController $testService = null, stdClass $someService = null): string
43+
public function injectService(TestGraphqlController $testService = null, stdClass $someService = null, stdClass $someAlias = null): string
4344
{
44-
if (!$testService instanceof TestGraphqlController || $someService === null) {
45+
if (!$testService instanceof TestGraphqlController || $someService === null || $someAlias === null) {
4546
return 'KO';
4647
}
4748
return 'OK';

Tests/Fixtures/config/services.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ services:
2020
someService:
2121
class: stdClass
2222

23+
someAlias:
24+
alias: someService
25+
2326
Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler:
2427
class: Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler
2528
# controllers are imported separately to make sure services can be injected

0 commit comments

Comments
 (0)