diff --git a/library/Icinga/Web/Widget/SearchDashboard.php b/library/Icinga/Web/Widget/SearchDashboard.php index ec8af60c7..39cc12555 100644 --- a/library/Icinga/Web/Widget/SearchDashboard.php +++ b/library/Icinga/Web/Widget/SearchDashboard.php @@ -29,14 +29,14 @@ class SearchDashboard extends Dashboard /** * Load all available search dashlets from modules * - * @param $searchQuery + * @param string $searchString * @return Dashboard|SearchDashboard */ - public static function search($searchQuery = '') + public static function search($searchString = '') { /** @var $dashboard SearchDashboard */ $dashboard = new static('searchDashboard'); - $dashboard->loadSearchDashlets($searchQuery); + $dashboard->loadSearchDashlets($searchString); return $dashboard; } diff --git a/test/php/library/Icinga/Web/Widget/SearchDashboardTest.php b/test/php/library/Icinga/Web/Widget/SearchDashboardTest.php index 407d4dfac..d42862ff6 100644 --- a/test/php/library/Icinga/Web/Widget/SearchDashboardTest.php +++ b/test/php/library/Icinga/Web/Widget/SearchDashboardTest.php @@ -14,7 +14,7 @@ class SearchDashboardTest extends BaseTestCase public function tearDown() { parent::tearDown(); - Mockery::close(); // Necessary because some tests run in a separate process + Mockery::close(); } protected function setupIcingaMock(\Zend_Controller_Request_Abstract $request) @@ -46,14 +46,14 @@ class SearchDashboardTest extends BaseTestCase /** * @expectedException Zend_Controller_Action_Exception */ - public function testFoo() + public function testWhetherRenderThrowsAnExceptionWhenHasNoComponents() { $dashboard = SearchDashboard::search('pending'); $dashboard->getPane('search')->removeComponents(); $dashboard->render(); } - public function testWhetherLoadLoadsSearchDashletsFromModules() + public function testWhetherSearchLoadsSearchDashletsFromModules() { $dashboard = SearchDashboard::search('pending'); @@ -62,10 +62,9 @@ class SearchDashboardTest extends BaseTestCase $this->assertTrue($result, 'Dashboard::search() could not load search dashlets from modules'); } - - public function testWhetherLoadProvidesHint() + public function testWhetherSearchProvidesHintWhenSearchStringIsEmpty() { - $dashboard = SearchDashboard::search(''); + $dashboard = SearchDashboard::search(); $result = $dashboard->getPane('search')->hasComponent('Ready to search');