Beispiel #1
0
 public function testGetServiceIds()
 {
     $sc = new Container();
     $sc->set('foo', $obj = new \stdClass());
     $sc->set('bar', $obj = new \stdClass());
     $this->assertEquals(array('service_container', 'foo', 'bar'), $sc->getServiceIds(), '->getServiceIds() returns all defined service ids');
     $sc = new ProjectServiceContainer();
     $this->assertEquals(array('scoped', 'scoped_foo', 'inactive', 'bar', 'foo_bar', 'foo.baz', 'circular', 'throw_exception', 'throws_exception_on_service_configuration', 'service_container'), $sc->getServiceIds(), '->getServiceIds() returns defined service ids by getXXXService() methods');
 }
Beispiel #2
0
 public function testGetServiceIds()
 {
     $sc = new Container();
     $sc->set('foo', $obj = new \stdClass());
     $sc->set('bar', $obj = new \stdClass());
     $this->assertEquals(array('service_container', 'foo', 'bar'), $sc->getServiceIds(), '->getServiceIds() returns all defined service ids');
     $sc = new ProjectServiceContainer();
     $sc->set('foo', $obj = new \stdClass());
     $this->assertEquals(array('service_container', 'internal', 'bar', 'foo_bar', 'foo.baz', 'circular', 'throw_exception', 'throws_exception_on_service_configuration', 'foo'), $sc->getServiceIds(), '->getServiceIds() returns defined service ids by factory methods in the method map, followed by service ids defined by set()');
 }