fix tests on PHP 5

This commit is contained in:
Christian Flothmann 2019-01-05 13:04:54 +01:00
parent 0a3d3d4dff
commit 6d84aeb131
2 changed files with 6 additions and 2 deletions

View File

@ -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();

View File

@ -33,6 +33,10 @@ class FactoryDummy extends FactoryParent
public static function createParent(): parent
{
}
public function createTestDefinition1()
{
}
}
class FactoryParent