Esempio n. 1
0
 /**
  * @expectedException Octahedron\Pulp\Assisted\AssistedInjectException
  * @expectedExceptionMessage Missing @Returns annotation in factory interface
  */
 public function testFactoryWithoutReturnsMethod()
 {
     $injectorMock = $this->getMockBuilder('Octahedron\\Pulp\\Injector')->disableOriginalConstructor()->getMock();
     $factoryProvider = new FactoryProvider('Octahedron\\Pulp\\Test\\Assisted\\InvalidFactory');
     $factoryProvider->setAnnotationReader(new AnnotationReader());
     $factoryProvider->initialise($injectorMock);
     $factory = $factoryProvider->get();
 }
Esempio n. 2
0
 public function installFactoryProvider(FactoryProvider $factoryProvider)
 {
     $factoryProvider->setAnnotationReader($this->annotationReader);
     $this->bind($factoryProvider->forInterface())->toProvider($factoryProvider);
 }