public function testGetMetadataForService()
 {
     $metadataFactory = $this->createMetadataFactory();
     $metadataFactory->expects($this->once())->method('getMetadataForClass')->with($this->equalTo('A'))->willReturn(null);
     $serviceRegistry = new DefaultServiceRegistry($metadataFactory, new DefaultNamingStrategy());
     $serviceRegistry->addService('A');
     $this->assertEquals(null, $serviceRegistry->getService('A'));
 }
Ejemplo n.º 2
0
 /**
  * @return DefaultServiceRegistry
  */
 protected function createServiceRegistry()
 {
     $registry = new DefaultServiceRegistry(new MetadataFactory(new AnnotationDriver(new AnnotationReader())), new DefaultNamingStrategy());
     $registry->importServices(new PathServiceLoader([__DIR__ . '/Services']));
     return $registry;
 }