/** * testGetAll * * @return void */ public function testGetAll() { $register = $this->register; $register->shouldReceive('get')->andReturn([MenuTypeInterface::class]); $moduleHandler = new ModuleHandler($register); $modules = $moduleHandler->getAll(); $this->assertEquals([MenuTypeInterface::class], $modules); }
/** * testGetAll * * @return void */ public function testGetAll() { $module = m::mock('\\stdClass', 'Xpressengine\\Menu\\MenuType\\MenuTypeInterface'); $module->shouldReceive('getId')->andReturn('id'); $module->shouldReceive('getComponentInfo')->with('name')->andReturn('title'); $module->shouldReceive('getComponentInfo')->with('description')->andReturn('description'); $module->shouldReceive('getComponentInfo')->with('screenshot')->andReturn('screenshot'); $register = $this->register; $register->shouldReceive('get')->andReturn([$module]); $moduleHandler = new ModuleHandler($register); $modules = $moduleHandler->getAll(); $this->assertInstanceOf(MenuTypeInterface::class, $modules[0]); }