/** * @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(); }
public function installFactoryProvider(FactoryProvider $factoryProvider) { $factoryProvider->setAnnotationReader($this->annotationReader); $this->bind($factoryProvider->forInterface())->toProvider($factoryProvider); }