$this->
assertSame($sc,
$sc->
get('service_container'
), '__construct() automatically registers itself as a service'
);
$sc =
new Container(new ParameterBag(['foo' => 'bar'
]));
$this->
assertEquals(['foo' => 'bar'
],
$sc->
getParameterBag()->
all(), '__construct() takes an array of parameters as its first argument'
);
} /**
* @dataProvider dataForTestCamelize
*/
public function testCamelize($id,
$expected) { $this->
assertEquals($expected, Container::
camelize($id),
sprintf('Container::camelize("%s")',
$id));
} public static function dataForTestCamelize() { return [ ['foo_bar', 'FooBar'
],
['foo.bar', 'Foo_Bar'
],
['foo.bar_baz', 'Foo_BarBaz'
],
['foo._bar', 'Foo_Bar'
],
['foo_.bar', 'Foo_Bar'
],
['_foo', 'Foo'
],
[