/**
  * testGetAllModuleInfo
  *
  * @return void
  */
 public function testGetAllModuleInfo()
 {
     $register = $this->register;
     $register->shouldReceive('get')->andReturn([FakeMenuTypeClass::class]);
     $moduleHandler = new ModuleHandler($register);
     $modules = $moduleHandler->getAllModuleInfo();
     $count = 0;
     foreach ($modules as $key => $value) {
         $count++;
     }
     $this->assertEquals(1, $count);
 }
Пример #2
0
 /**
  * testGetAllModuleInfo
  *
  * @return void
  */
 public function testGetAllModuleInfo()
 {
     $module = m::mock('\\stdClass');
     $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->getAllModuleInfo();
     $count = 0;
     foreach ($modules as $key => $value) {
         $count++;
     }
     $this->assertEquals(1, $count);
 }