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); }
public function build() { $binder = new Binding\Binder($this->annotationReader); foreach ($this->modules as $module) { $binder->install($module); } return new Injector($binder, $this->annotationReader); }