Again more test functions
这个提交存在于:
父节点
da86b9d840
当前提交
9eb3675251
共有 1 个文件被更改,包括 19 次插入 和 1 次删除
|
@ -548,7 +548,7 @@ class PageTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertFalse ($currentPage->ContainsBook ());
|
||||
}
|
||||
|
||||
public function testPageSearch ()
|
||||
public function testPageSearch_WithOnlyBooksReturned ()
|
||||
{
|
||||
global $config;
|
||||
$page = Base::PAGE_OPENSEARCH_QUERY;
|
||||
|
@ -565,9 +565,16 @@ class PageTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertEquals ("Search result for *alice* in books", $currentPage->entryArray [0]->title);
|
||||
$this->assertEquals ("2 books", $currentPage->entryArray [0]->content);
|
||||
$this->assertFalse ($currentPage->ContainsBook ());
|
||||
}
|
||||
|
||||
public function testPageSearch_WithAuthorsIgnored ()
|
||||
{
|
||||
global $config;
|
||||
$page = Base::PAGE_OPENSEARCH_QUERY;
|
||||
// Match Lewis Caroll & Scarlet
|
||||
$query = "car";
|
||||
$qid = NULL;
|
||||
$n = "1";
|
||||
|
||||
$config ['cops_ignored_categories'] = array ("author");
|
||||
$currentPage = Page::getPage ($page, $qid, $query, $n);
|
||||
|
@ -580,6 +587,17 @@ class PageTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertFalse ($currentPage->ContainsBook ());
|
||||
|
||||
$config ['cops_ignored_categories'] = array ();
|
||||
}
|
||||
|
||||
public function testPageSearch_WithTwoCategories ()
|
||||
{
|
||||
global $config;
|
||||
$page = Base::PAGE_OPENSEARCH_QUERY;
|
||||
// Match Lewis Caroll & Scarlet
|
||||
$query = "car";
|
||||
$qid = NULL;
|
||||
$n = "1";
|
||||
|
||||
$currentPage = Page::getPage ($page, $qid, $query, $n);
|
||||
$currentPage->InitializeContent ();
|
||||
|
||||
|
|
正在加载…
添加表格
添加链接
在新工单中引用