From d6d63e7ee3b4c9b3a15f76c980f4c08e23b790d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sun, 8 Dec 2013 21:14:20 +0100 Subject: [PATCH] New test for the previous configuration item. re #123 --- test/pageTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/pageTest.php b/test/pageTest.php index 91c858f..3b8ceb6 100644 --- a/test/pageTest.php +++ b/test/pageTest.php @@ -491,6 +491,7 @@ class PageTest extends PHPUnit_Framework_TestCase public function testPageSearch () { + global $config; $page = Base::PAGE_OPENSEARCH_QUERY; $query = "alice"; $qid = NULL; @@ -508,6 +509,17 @@ class PageTest extends PHPUnit_Framework_TestCase // Match Lewis Caroll & Scarlet $query = "car"; + + $config ['cops_ingored_search_scope'] = array ("author"); + $currentPage = Page::getPage ($page, $qid, $query, $n); + $currentPage->InitializeContent (); + + $this->assertEquals ("Search result for *car*", $currentPage->title); + $this->assertCount (1, $currentPage->entryArray); + $this->assertEquals ("A Study in Scarlet", $currentPage->entryArray [0]->title); + $this->assertTrue ($currentPage->ContainsBook ()); + + $config ['cops_ingored_search_scope'] = array (); $currentPage = Page::getPage ($page, $qid, $query, $n); $currentPage->InitializeContent ();