The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit 06dc5ce6 authored by Demian Katz's avatar Demian Katz
Browse files

More test coverage.

parent 1f1de696
No related merge requests found
......@@ -34,6 +34,7 @@ use VuFindSearch\ParamBag;
use VuFindSearch\Backend\BackendInterface;
use VuFindSearch\Backend\Exception\BackendException;
use VuFindSearch\Feature\RetrieveBatchInterface;
use VuFindSearch\Query\Query;
use VuFindSearch\Response\AbstractRecordCollection;
use PHPUnit_Framework_TestCase as TestCase;
......@@ -102,6 +103,28 @@ class SearchServiceTest extends TestCase
$service->retrieve('foo', 'bar', $params);
}
/**
* Test exception-throwing search action.
*
* @return void
* @expectedException VuFindSearch\Backend\Exception\BackendException
* @expectedExceptionMessage test
*/
public function testSearchException()
{
$service = $this->getService();
$backend = $this->getBackend();
$exception = new BackendException('test');
$backend->expects($this->once())->method('search')
->will($this->throwException($exception));
$em = $service->getEventManager();
$em->expects($this->at(0))->method('trigger')
->with($this->equalTo('pre'), $this->equalTo($backend));
$em->expects($this->at(1))->method('trigger')
->with($this->equalTo('error'), $this->equalTo($exception));
$service->search('foo', new Query('test'));
}
/**
* Test batch retrieve (with RetrieveBatchInterface).
*
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment