mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
SearchDashboard: adjust SearchDashboardTest and rename searchQuery to searchString
This commit is contained in:
parent
0f7f2f2d8b
commit
ba623d0544
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user