Skip to content

Commit eb9e4fa

Browse files
committed
Merge branch '2.3' into 2.7
* 2.3: [DependencyInjection] Add coverage for all invalid arguments in exportParameters
2 parents 0134b86 + 26baa9a commit eb9e4fa

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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
{
@@ -85,14 +86,24 @@ public function testDumpRelativeDir()
8586
}
8687

8788
/**
89+
* @dataProvider provideInvalidParameters
8890
* @expectedException \InvalidArgumentException
8991
*/
90-
public function testExportParameters()
92+
public function testExportParameters($parameters)
9193
{
92-
$dumper = new PhpDumper(new ContainerBuilder(new ParameterBag(array('foo' => new Reference('foo')))));
94+
$dumper = new PhpDumper(new ContainerBuilder(new ParameterBag($parameters)));
9395
$dumper->dump();
9496
}
9597

98+
public function provideInvalidParameters()
99+
{
100+
return array(
101+
array(array('foo' => new Definition('stdClass'))),
102+
array(array('foo' => new Reference('foo'))),
103+
array(array('foo' => new Variable('foo'))),
104+
);
105+
}
106+
96107
public function testAddParameters()
97108
{
98109
$container = include self::$fixturesPath.'/containers/container8.php';

0 commit comments

Comments
 (0)