コード例 #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();
 }
コード例 #2
0
ファイル: Binder.php プロジェクト: octahedron/pulp
 public function installFactoryProvider(FactoryProvider $factoryProvider)
 {
     $factoryProvider->setAnnotationReader($this->annotationReader);
     $this->bind($factoryProvider->forInterface())->toProvider($factoryProvider);
 }