Fix failing search dashboard test

This commit is contained in:
Eric Lippmann 2015-08-25 16:56:26 +02:00
parent c294283636
commit 176177d874
1 changed files with 9 additions and 2 deletions

View File

@ -22,12 +22,14 @@ namespace Icinga\Test {
use Exception; use Exception;
use RuntimeException; use RuntimeException;
use stdClass;
use Mockery; use Mockery;
use PHPUnit_Framework_TestCase; use PHPUnit_Framework_TestCase;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Data\ConfigObject; use Icinga\Data\ConfigObject;
use Icinga\Data\ResourceFactory;
use Icinga\Data\Db\DbConnection; use Icinga\Data\Db\DbConnection;
use Icinga\Data\ResourceFactory;
use Icinga\Web\View;
/** /**
* Class BaseTestCase * Class BaseTestCase
@ -167,7 +169,12 @@ namespace Icinga\Test {
return $libDir; return $libDir;
}) })
->shouldReceive('getRequest')->andReturn($requestMock) ->shouldReceive('getRequest')->andReturn($requestMock)
->shouldReceive('getResponse')->andReturn($responseMock); ->shouldReceive('getResponse')->andReturn($responseMock)
->shouldReceive('getViewRenderer')->andReturnUsing(function () {
$viewRenderer = new stdClass();
$viewRenderer->view = new View();
return $viewRenderer;
});
Icinga::setApp($bootstrapMock, true); Icinga::setApp($bootstrapMock, true);
return $bootstrapMock; return $bootstrapMock;