New test for the previous configuration item. re #123

This commit is contained in:
Sébastien Lucas 2013-12-08 21:14:20 +01:00
parent 7ba85d150b
commit d6d63e7ee3

View file

@ -491,6 +491,7 @@ class PageTest extends PHPUnit_Framework_TestCase
public function testPageSearch () public function testPageSearch ()
{ {
global $config;
$page = Base::PAGE_OPENSEARCH_QUERY; $page = Base::PAGE_OPENSEARCH_QUERY;
$query = "alice"; $query = "alice";
$qid = NULL; $qid = NULL;
@ -508,6 +509,17 @@ class PageTest extends PHPUnit_Framework_TestCase
// Match Lewis Caroll & Scarlet // Match Lewis Caroll & Scarlet
$query = "car"; $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 = Page::getPage ($page, $qid, $query, $n);
$currentPage->InitializeContent (); $currentPage->InitializeContent ();