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

Appearance settings

Commit c8ced3a

Browse filesBrowse files
committed
properly fix tests on PHP 5
1 parent 6d84aeb commit c8ced3a
Copy full SHA for c8ced3a

File tree

Expand file treeCollapse file tree

4 files changed

+41
-8
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+41
-8
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveNamedArgumentsPassTest.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Symfony\Component\DependencyInjection\ContainerBuilder;
1717
use Symfony\Component\DependencyInjection\Reference;
1818
use Symfony\Component\DependencyInjection\Tests\Fixtures\CaseSensitiveClass;
19-
use Symfony\Component\DependencyInjection\Tests\Fixtures\FactoryDummy;
19+
use Symfony\Component\DependencyInjection\Tests\Fixtures\FactoryDummyWithoutReturnTypes;
2020
use Symfony\Component\DependencyInjection\Tests\Fixtures\NamedArgumentsDummy;
2121
use Symfony\Component\DependencyInjection\Tests\Fixtures\SimilarArgumentsDummy;
2222
use Symfony\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
public function testCorrectMethodReportedInException()
125125
{
126126
$container = new ContainerBuilder();
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 = new ResolveNamedArgumentsPass();

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ public static function createSelf(): self
3333
public static function createParent(): parent
3434
{
3535
}
36-
37-
public function createTestDefinition1()
38-
{
39-
}
4036
}
4137

4238
class FactoryParent
+19Lines 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+
namespace Symfony\Component\DependencyInjection\Tests\Fixtures;
13+
14+
class FactoryDummyWithoutReturnTypes
15+
{
16+
public function createTestDefinition1()
17+
{
18+
}
19+
}
+18Lines 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+
namespace Symfony\Component\DependencyInjection\Tests\Fixtures;
13+
14+
use Symfony\Component\DependencyInjection\Definition;
15+
16+
class TestDefinition1 extends Definition
17+
{
18+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.