DashboardTest: Drop test testLoadPaneItemsProvidedByEnabledModules
refs #5600
This commit is contained in:
parent
8c17364780
commit
d1fa5e8fce
|
@ -9,7 +9,6 @@ require_once realpath(dirname(__FILE__) . '/../../../../bootstrap.php');
|
|||
|
||||
use Mockery;
|
||||
use Icinga\Test\BaseTestCase;
|
||||
use Icinga\User;
|
||||
use Icinga\Web\Widget\Dashboard;
|
||||
use Icinga\Web\Widget\Dashboard\Pane;
|
||||
use Icinga\Web\Widget\Dashboard\Dashlet;
|
||||
|
@ -46,23 +45,6 @@ class DashboardTest extends BaseTestCase
|
|||
Mockery::close(); // Necessary because some tests run in a separate process
|
||||
}
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$moduleMock = Mockery::mock('Icinga\Application\Modules\Module');
|
||||
$moduleMock->shouldReceive('getPaneItems')->andReturn(array(
|
||||
'test-pane' => new Pane('Test Pane')
|
||||
));
|
||||
$moduleMock->shouldReceive('getName')->andReturn('test');
|
||||
|
||||
$moduleManagerMock = Mockery::mock('Icinga\Application\Modules\Manager');
|
||||
$moduleManagerMock->shouldReceive('getLoadedModules')->andReturn(array(
|
||||
'test-module' => $moduleMock
|
||||
));
|
||||
|
||||
$bootstrapMock = $this->setupIcingaMock();
|
||||
$bootstrapMock->shouldReceive('getModuleManager')->andReturn($moduleManagerMock);
|
||||
}
|
||||
|
||||
public function testWhetherCreatePaneCreatesAPane()
|
||||
{
|
||||
$dashboard = new Dashboard();
|
||||
|
@ -126,24 +108,6 @@ class DashboardTest extends BaseTestCase
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testWhetherCreatePaneCreatesAPane
|
||||
*/
|
||||
public function testLoadPaneItemsProvidedByEnabledModules()
|
||||
{
|
||||
$user = new User('test');
|
||||
$user->setPermissions(array('*' => '*'));
|
||||
$dashboard = new Dashboard();
|
||||
$dashboard->setUser($user);
|
||||
$dashboard->load();
|
||||
|
||||
$this->assertCount(
|
||||
1,
|
||||
$dashboard->getPanes(),
|
||||
'Dashboard::load() could not load panes from enabled modules'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Icinga\Exception\ProgrammingError
|
||||
* @depends testWhetherCreatePaneCreatesAPane
|
||||
|
|
Loading…
Reference in New Issue