diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveNamedArgumentsPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveNamedArgumentsPassTest.php index 087d7ab795..c994ff99c3 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveNamedArgumentsPassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveNamedArgumentsPassTest.php @@ -119,7 +119,7 @@ class ResolveNamedArgumentsPassTest extends TestCase /** * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - * @expectedExceptionMessage Invalid service "Symfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition1": method "Symfony\Component\DependencyInjection\Tests\Fixtures\FactoryDummy::create()" has no argument named "$notFound". Check your service definition. + * @expectedExceptionMessage Invalid service "Symfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition1": method "Symfony\Component\DependencyInjection\Tests\Fixtures\FactoryDummy::createTestDefinition1()" has no argument named "$notFound". Check your service definition. */ public function testCorrectMethodReportedInException() { @@ -128,7 +128,7 @@ class ResolveNamedArgumentsPassTest extends TestCase $container->register(FactoryDummy::class, FactoryDummy::class); $definition = $container->register(TestDefinition1::class, TestDefinition1::class); - $definition->setFactory(array(FactoryDummy::class, 'create')); + $definition->setFactory(array(FactoryDummy::class, 'createTestDefinition1')); $definition->setArguments(array('$notFound' => '123')); $pass = new ResolveNamedArgumentsPass(); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php index da984b562a..04aa5fa282 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php @@ -33,6 +33,10 @@ class FactoryDummy extends FactoryParent public static function createParent(): parent { } + + public function createTestDefinition1() + { + } } class FactoryParent