コード例 #1
0
ファイル: BinderTest.php プロジェクト: octahedron/pulp
 public function testSameModuleInstallsOnlyOnce()
 {
     $moduleMock = $this->getMockBuilder('Octahedron\\Pulp\\Module')->setMethods(['setBinder', 'configure'])->getMock();
     $binder = new Binder(new AnnotationReader());
     $moduleMock->expects($this->once())->method('setBinder');
     $moduleMock->expects($this->once())->method('configure');
     $binder->install($moduleMock);
     $binder->install($moduleMock);
 }
コード例 #2
0
ファイル: InjectorBuilder.php プロジェクト: octahedron/pulp
 public function build()
 {
     $binder = new Binding\Binder($this->annotationReader);
     foreach ($this->modules as $module) {
         $binder->install($module);
     }
     return new Injector($binder, $this->annotationReader);
 }