Пример #1
0
 public function testAddPaths()
 {
     $initialCount = count($this->driver->getPaths());
     $this->driver->addPaths(array('testpath', 'testpath2'));
     $paths = $this->driver->getPaths();
     $this->assertEquals($initialCount + 2, count($this->driver->getPaths()));
     $this->assertContains('testpath', $paths);
     $this->assertContains('testpath2', $paths);
 }
 /**
  * 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);
 }