From 6d84aeb131684fdc639d3a8a5e20912781622a5f Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 5 Jan 2019 13:04:54 +0100 Subject: [PATCH] fix tests on PHP 5 --- .../Tests/Compiler/ResolveNamedArgumentsPassTest.php | 4 ++-- .../DependencyInjection/Tests/Fixtures/FactoryDummy.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveNamedArgumentsPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveNamedArgumentsPassTest.php index 087d7ab79508..c994ff99c3c1 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveNamedArgumentsPassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveNamedArgumentsPassTest.php @@ -119,7 +119,7 @@ public function testArgumentNotFound() /** * @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 @@ public function testCorrectMethodReportedInException() $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 da984b562a39..04aa5fa28280 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php @@ -33,6 +33,10 @@ public static function createSelf(): self public static function createParent(): parent { } + + public function createTestDefinition1() + { + } } class FactoryParent