File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 1616use Symfony \Component \DependencyInjection \ParameterBag \ParameterBag ;
1717use Symfony \Component \DependencyInjection \Reference ;
1818use Symfony \Component \DependencyInjection \Definition ;
19+ use Symfony \Component \DependencyInjection \Variable ;
20+ use Symfony \Component \ExpressionLanguage \Expression ;
1921
2022class PhpDumperTest extends \PHPUnit_Framework_TestCase
2123{
@@ -85,14 +87,25 @@ public function testDumpRelativeDir()
8587 }
8688
8789 /**
90+ * @dataProvider provideInvalidParameters
8891 * @expectedException \InvalidArgumentException
8992 */
90- public function testExportParameters ()
93+ public function testExportParameters ($ parameters )
9194 {
92- $ dumper = new PhpDumper (new ContainerBuilder (new ParameterBag (array ( ' foo ' => new Reference ( ' foo ' )) )));
95+ $ dumper = new PhpDumper (new ContainerBuilder (new ParameterBag ($ parameters )));
9396 $ dumper ->dump ();
9497 }
9598
99+ public function provideInvalidParameters ()
100+ {
101+ return array (
102+ array (array ('foo ' => new Definition ('stdClass ' ))),
103+ array (array ('foo ' => new Expression ('service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default") ' ))),
104+ array (array ('foo ' => new Reference ('foo ' ))),
105+ array (array ('foo ' => new Variable ('foo ' ))),
106+ );
107+ }
108+
96109 public function testAddParameters ()
97110 {
98111 $ container = include self ::$ fixturesPath .'/containers/container8.php ' ;
You can’t perform that action at this time.
0 commit comments