Esempio n. 1
0
 public function testNotifyingPreviouslyInstantiatedService()
 {
     $container = new Container();
     $collectionServiceClass = $this->collectionServiceClass;
     $container->set('collection', new $collectionServiceClass());
     $collection = $container->get('collection');
     $this->assertCount(0, $collection->getServices());
     $container->register('one', array('class' => $this->simpleServiceClass, 'notify' => array(array('collection', 'addService', array('@', 'one')))));
     $this->assertCount(1, $collection->getServices());
     $this->assertSame($container->get('one'), $collection->getService('one'));
 }