8000 minor #18500 [DependencyInjection] Add coverage for all invalid argum… · symfony/symfony@302e192 · GitHub
[go: up one dir, main page]

Skip to content

Commit 302e192

Browse files
committed
minor #18500 [DependencyInjection] Add coverage for all invalid arguments in exportParameters (JhonnyL)
This PR was merged into the 2.3 branch. Discussion ---------- [DependencyInjection] Add coverage for all invalid arguments in exportParameters | Q | A | ------------- | --- | Branch? | 2.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Commits ------- 87c4f23 [DependencyInjection] Add coverage for all invalid arguments in exportParameters
2 parents 416f7d7 + 87c4f23 commit 302e192

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
1717
use Symfony\Component\DependencyInjection\Reference;
1818
use Symfony\Component\DependencyInjection\Definition;
19+
use Symfony\Component\DependencyInjection\Variable;
1920

2021
class PhpDumperTest extends \PHPUnit_Framework_TestCase
2122
{
@@ -100,14 +101,24 @@ public function testDumpRelativeDir()
100101
}
101102

102103
/**
104+
* @dataProvider provideInvalidParameters
103105
* @expectedException \InvalidArgumentException
104106
*/
105-
public function testExportParameters()
107+
public function testExportParameters($parameters)
106108
{
107-
964D $dumper = new PhpDumper(new ContainerBuilder(new ParameterBag(array('foo' => new Reference('foo')))));
109+
$dumper = new PhpDumper(new ContainerBuilder(new ParameterBag($parameters)));
108110
$dumper->dump();
109111
}
110112

113+
public function provideInvalidParameters()
114+
{
115+
return array(
116+
array(array('foo' => new Definition('stdClass'))),
117+
array(array('foo' => new Reference('foo'))),
118+
array(array('foo' => new Variable('foo'))),
119+
);
120+
}
121+
111122
public function testAddParameters()
112123
{
113124
$container = include self::$fixturesPath.'/containers/container8.php';

0 commit comments

Comments
 (0)
0