From 25722218122ab66489a39591cd724b3db26faa2c Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Thu, 9 Oct 2014 14:54:57 -0400 Subject: [PATCH] Filled gaps in coverage. --- .../Controller/Plugin/NewItemsTest.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/NewItemsTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/NewItemsTest.php index fa528d9bf93..436e6e0e90e 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/NewItemsTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/NewItemsTest.php @@ -103,6 +103,17 @@ class NewItemsTest extends TestCase $this->assertEquals(array('a', 'b', 'c'), $newItems->getFundList()); } + /** + * Test getFundList() in non-ILS mode. + * + * @return void + */ + public function testGetFundListWithoutILS() + { + $newItems = new NewItems(new Config(array('method' => 'solr'))); + $this->assertEquals(array(), $newItems->getFundList()); + } + /** * Test a single hidden filter. * @@ -167,6 +178,19 @@ class NewItemsTest extends TestCase $this->assertEquals(2, $newItems->getResultPages()); } + /** + * Test illegal result pages setting. + * + * @return void + */ + public function testIllegalResultPages() + { + $config = new Config(array('result_pages' => '-2')); + $newItems = new NewItems($config); + // expect a default of 10 if a bad value was passed in + $this->assertEquals(10, $newItems->getResultPages()); + } + /** * Test Solr filter generator. * -- GitLab