File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 16
16
use Symfony \Component \DependencyInjection \ParameterBag \ParameterBag ;
17
17
use Symfony \Component \DependencyInjection \Reference ;
18
18
use Symfony \Component \DependencyInjection \Definition ;
19
+ use Symfony \Component \DependencyInjection \Variable ;
19
20
20
21
class PhpDumperTest extends \PHPUnit_Framework_TestCase
21
22
{
@@ -85,14 +86,24 @@ public function testDumpRelativeDir()
85
86
}
86
87
87
88
/**
89
+ * @dataProvider provideInvalidParameters
88
90
* @expectedException \InvalidArgumentException
89
91
*/
90
- public function testExportParameters ()
92
+ public function testExportParameters ($ parameters )
91
93
{
92
- $ dumper = new PhpDumper (new ContainerBuilder (new ParameterBag (array ( ' foo ' => new Reference ( ' foo ' )) )));
94
+ $ dumper = new PhpDumper (new ContainerBuilder (new ParameterBag ($ parameters )));
93
95
$ dumper ->dump ();
94
96
}
95
97
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
+
96
107
public function testAddParameters ()
97
108
{
98
109
$ container = include self ::$ fixturesPath .'/containers/container8.php ' ;
You can’t perform that action at this time.
0 commit comments