tests: The app is soon not mocked anymore, so don't use it as such
This commit is contained in:
parent
e572652f4c
commit
776e0803fa
|
@ -42,7 +42,6 @@ class AuthenticationBackendReorderFormTest extends BaseTestCase
|
|||
)
|
||||
);
|
||||
|
||||
Icinga::app()->shouldReceive('getModuleManager->getLoadedModules')->andReturn([]);
|
||||
$this->getRequestMock()->shouldReceive('getMethod')->andReturn('POST')
|
||||
->shouldReceive('isPost')->andReturn(true)
|
||||
->shouldReceive('getPost')->andReturn(array('backend_newpos' => 'test3|1'));
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
namespace Tests\Icinga\Web;
|
||||
|
||||
use Icinga\Application\Icinga;
|
||||
use Icinga\Authentication\Role;
|
||||
use Mockery;
|
||||
use Icinga\Test\BaseTestCase;
|
||||
use Icinga\User;
|
||||
use Icinga\Web\Widget\SearchDashboard;
|
||||
|
@ -13,23 +13,12 @@ class SearchDashboardTest extends BaseTestCase
|
|||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
$moduleMock = Mockery::mock('Icinga\Application\Modules\Module');
|
||||
$searchUrl = (object) array(
|
||||
'title' => 'Hosts',
|
||||
'url' => 'monitoring/list/hosts?sort=host_severity&limit=10'
|
||||
);
|
||||
$moduleMock->shouldReceive('getSearchUrls')->andReturn(array(
|
||||
$searchUrl
|
||||
));
|
||||
$moduleMock->shouldReceive('getName')->andReturn('test');
|
||||
parent::setUp();
|
||||
|
||||
$moduleManagerMock = Mockery::mock('Icinga\Application\Modules\Manager');
|
||||
$moduleManagerMock->shouldReceive('getLoadedModules')->andReturn(array(
|
||||
'test-module' => $moduleMock
|
||||
));
|
||||
|
||||
$bootstrapMock = $this->setupIcingaMock();
|
||||
$bootstrapMock->shouldReceive('getModuleManager')->andReturn($moduleManagerMock);
|
||||
Icinga::app()->getModuleManager()
|
||||
->loadModule('test-module', '/tmp')
|
||||
->getModule('test-module')
|
||||
->provideSearchUrl('Hosts', 'monitoring/list/hosts?sort=host_severity&limit=10');
|
||||
}
|
||||
|
||||
public function testWhetherRenderThrowsAnExceptionWhenHasNoDashlets()
|
||||
|
|
Loading…
Reference in New Issue