File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/Symfony/Component/DependencyInjection/Tests/Dumper 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
{
@@ -100,14 +101,24 @@ public function testDumpRelativeDir()
100
101
}
101
102
102
103
/**
104
+ * @dataProvider provideInvalidParameters
103
105
* @expectedException \InvalidArgumentException
104
106
*/
105
- public function testExportParameters ()
107
+ public function testExportParameters ($ parameters )
106
108
{
107
- $ dumper = new PhpDumper (new ContainerBuilder (new ParameterBag (array ( ' foo ' => new Reference ( ' foo ' )) )));
109
+ $ dumper = new PhpDumper (new ContainerBuilder (new ParameterBag ($ parameters )));
108
110
$ dumper ->dump ();
109
111
}
110
112
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
+
111
122
public function testAddParameters ()
112
123
{
113
124
$ container = include self ::$ fixturesPath .'/containers/container8.php ' ;
You can’t perform that action at this time.
0 commit comments