Skip to content

Commit

Permalink
DashletTest: Add test for creating dashlets from multiple modules
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Jun 10, 2022
1 parent c27a471 commit 65fc8e1
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/php/library/Icinga/Web/Dashboard/DashletTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,36 @@ public function testWhetherManageEntryManagesANewDashlet()
);
}

/**
* @depends testWhetherManageEntryManagesANewDashlet
*/
public function testWhetherManageEntryManagesNewDashletsFromMultipleModules()
{
$home = $this->getTestHome();
$this->dashboard->manageEntry($home);

$pane = new Pane('Test Pane');
$home->manageEntry($pane);

$moduleDashlets = [
'monitoring' => ['Service Problems' => $this->getTestDashlet('Service Problems')],
'icingadb' => ['Host Problems' => $this->getTestDashlet('Host Problems')]
];

$pane->manageEntry($moduleDashlets);

$this->dashboard->load(self::TEST_HOME);

$home = $this->dashboard->getActiveHome();
$pane = $home->getActivePane();

$this->assertCount(
2,
$pane->getEntries(),
'Pane::manageEntry() could not manage new Dashlets from multiple modules'
);
}

/**
* @depends testWhetherManageEntryManagesANewDashlet
*/
Expand Down

0 comments on commit 65fc8e1

Please sign in to comment.