diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php index 777b2b31e8f19389616aca3e61f4f968fbdf95ac..f9105253cb53287d4db37b210f6db29b07fa1b7a 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php @@ -29,6 +29,7 @@ namespace VuFindTest\Backend\Solr; +use VuFindSearch\Backend\Exception\RemoteErrorException; use VuFindSearch\Backend\Solr\Backend; use VuFindSearch\Backend\Solr\HandlerMap; use VuFindSearch\ParamBag; @@ -215,6 +216,24 @@ class BackendTest extends PHPUnit_Framework_TestCase $this->assertEquals('foo', $back->getIdentifier()); } + /** + * Test refining an alphabrowse exception. + * + * @return void + * @expectedException VuFindSearch\Backend\Exception\RemoteErrorException + * @expectedExceptionMessage Alphabetic Browse index missing. + */ + public function testRefineAlphaBrowseException() + { + $conn = $this->getConnectorMock(array('query')); + $e = new RemoteErrorException('does not exist', 400, new \Zend\Http\Response()); + $conn->expects($this->once())->method('query') + ->with($this->equalTo('browse')) + ->will($this->throwException($e)); + $back = new Backend($conn); + $back->alphabeticBrowse('foo', 'bar', 1); + } + /// Internal API /**