/**
  * Creates a fresh instance of the ServiceMetadataFactory
  * @return \BedRest\Service\Mapping\ServiceMetadataFactory
  */
 protected function createFactory()
 {
     $reader = new AnnotationReader();
     $driver = new AnnotationDriver($reader);
     $driver->addPaths(array(TESTS_BASEDIR . '/BedRest/TestFixtures/Services/Company'));
     return new ServiceMetadataFactory($driver);
 }
 /**
  * Returns a ServiceMetadataFactory instance, pre-configured to use the BedRest\TestFixtures\Services classes.
  *
  * @return \BedRest\Service\Mapping\ServiceMetadataFactory
  */
 protected function getServiceMetadataFactory()
 {
     $driver = new ServiceAnnotationDriver(new AnnotationReader());
     $driver->addPaths(array('BedRest\\TestFixtures\\Services' => TESTS_BASEDIR . '/BedRest/TestFixtures/Services'));
     return new ServiceMetadataFactory($driver);
 }
Exemplo n.º 3
0
 public function testLoadMetadataForInvalidServiceThrowsException()
 {
     $this->setExpectedException('BedRest\\Service\\Mapping\\Exception');
     $sm = $this->getMock('BedRest\\Service\\Mapping\\ServiceMetadata', array(), array(), '', false);
     $this->driver->loadMetadataForClass('BedRest\\TestFixtures\\Services\\InvalidService', $sm);
 }