public function testRegisterAbstract() { $boundWith = function () { return true; }; $boundWill = function ($serviceName) { switch ($serviceName) { case 'commode.common.loaded': return false; } dd('bound', $serviceName); return true; }; $makeWill = function ($make) { switch ($make) { case 'commode.common.ghostservice': return $this->ghostServices; break; case 'commode.common.resolver': return $this->resolver; break; } dd('make', func_get_args()); }; $this->applicationMock->expects($this->any())->method('getLoadedProviders')->will($this->returnValue([])); $this->applicationMock->expects($this->any())->method('bound')->with($this->callback($boundWith))->will($this->returnCallback($boundWill)); $this->applicationMock->expects($this->any())->method('make')->will($this->returnCallback($makeWill)); $this->ghostService->register(); $this->commonGhostService->register(); }
public function testProvides() { $this->assertSame([ServiceShortCuts::GHOST_SERVICE, ServiceShortCuts::RESOLVER_SERVICE], $this->commodeService->provides()); }