Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc8ced3a

Browse files
committed
properly fix tests on PHP 5
1 parent6d84aeb commitc8ced3a

File tree

4 files changed

+41
-8
lines changed

4 files changed

+41
-8
lines changed

‎src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveNamedArgumentsPassTest.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
useSymfony\Component\DependencyInjection\ContainerBuilder;
1717
useSymfony\Component\DependencyInjection\Reference;
1818
useSymfony\Component\DependencyInjection\Tests\Fixtures\CaseSensitiveClass;
19-
useSymfony\Component\DependencyInjection\Tests\Fixtures\FactoryDummy;
19+
useSymfony\Component\DependencyInjection\Tests\Fixtures\FactoryDummyWithoutReturnTypes;
2020
useSymfony\Component\DependencyInjection\Tests\Fixtures\NamedArgumentsDummy;
2121
useSymfony\Component\DependencyInjection\Tests\Fixtures\SimilarArgumentsDummy;
2222
useSymfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition1;
@@ -119,16 +119,16 @@ public function testArgumentNotFound()
119119

120120
/**
121121
* @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
122-
* @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.
122+
* @expectedExceptionMessage Invalid service "Symfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition1": method "Symfony\Component\DependencyInjection\Tests\Fixtures\FactoryDummyWithoutReturnTypes::createTestDefinition1()" has no argument named "$notFound". Check your service definition.
123123
*/
124124
publicfunctiontestCorrectMethodReportedInException()
125125
{
126126
$container =newContainerBuilder();
127127

128-
$container->register(FactoryDummy::class,FactoryDummy::class);
128+
$container->register(FactoryDummyWithoutReturnTypes::class,FactoryDummyWithoutReturnTypes::class);
129129

130130
$definition =$container->register(TestDefinition1::class, TestDefinition1::class);
131-
$definition->setFactory(array(FactoryDummy::class,'createTestDefinition1'));
131+
$definition->setFactory(array(FactoryDummyWithoutReturnTypes::class,'createTestDefinition1'));
132132
$definition->setArguments(array('$notFound' =>'123'));
133133

134134
$pass =newResolveNamedArgumentsPass();

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ public static function createSelf(): self
3333
publicstaticfunctioncreateParent():parent
3434
{
3535
}
36-
37-
publicfunctioncreateTestDefinition1()
38-
{
39-
}
4036
}
4137

4238
class FactoryParent
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespaceSymfony\Component\DependencyInjection\Tests\Fixtures;
13+
14+
class FactoryDummyWithoutReturnTypes
15+
{
16+
publicfunctioncreateTestDefinition1()
17+
{
18+
}
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespaceSymfony\Component\DependencyInjection\Tests\Fixtures;
13+
14+
useSymfony\Component\DependencyInjection\Definition;
15+
16+
class TestDefinition1extends Definition
17+
{
18+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp