From c877773128bde6b210e1e0808711b9b8e23098a4 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Mon, 13 Jan 2014 13:17:01 -0500
Subject: [PATCH] Improved test coverage.

---
 .../VuFindTest/Backend/Solr/BackendTest.php   | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

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 777b2b31e8f..f9105253cb5 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
 
     /**
-- 
GitLab