'Foo_Bar', 'foo.bar'
],
['Foo_BarBaz', 'foo.bar_baz'
],
['FooBar_BazQux', 'foo_bar.baz_qux'
],
['_Foo', '.foo'
],
['Foo_', 'foo.'
],
];
} public function testCompile() { $sc =
new Container(new ParameterBag(['foo' => 'bar'
]));
$this->
assertFalse($sc->
getParameterBag()->
isResolved(), '->compile() resolves the parameter bag'
);
$sc->
compile();
$this->
assertTrue($sc->
getParameterBag()->
isResolved(), '->compile() resolves the parameter bag'
);
$this->
assertInstanceOf(FrozenParameterBag::
class,
$sc->
getParameterBag(), '->compile() changes the parameter bag to a FrozenParameterBag instance'
);
$this->
assertEquals(['foo' => 'bar'
],
$sc->
getParameterBag()->
all(), '->compile() copies the current parameters to the new parameter bag'
);
} public function testIsCompiled() { $sc =
new Container(new ParameterBag(['foo' => 'bar'
]));
$this->
assertFalse($sc->
isCompiled(), '->isCompiled() returns false if the container is not compiled'
);
$sc->
compile();