Exemplo n.º 1
0
 public function testFactoryProviderInstall()
 {
     $annotationReaderMock = $this->getMock('Doctrine\\Common\\Annotations\\Reader');
     $factoryProviderMock = $this->getMockBuilder('Octahedron\\Pulp\\Assisted\\FactoryProvider')->disableOriginalConstructor()->setMethods(['setAnnotationReader'])->getMock();
     $factoryProviderMock->expects($this->once())->method('setAnnotationReader')->with($this->identicalTo($annotationReaderMock));
     $binder = new Binder($annotationReaderMock);
     $binder->installFactoryProvider($factoryProviderMock);
 }
Exemplo n.º 2
0
 public function build()
 {
     $binder = new Binding\Binder($this->annotationReader);
     foreach ($this->modules as $module) {
         $binder->install($module);
     }
     return new Injector($binder, $this->annotationReader);
 }