From da86b9d8406f0870993ef636589ba3257709bfee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Wed, 30 Apr 2014 13:54:59 +0200 Subject: [PATCH] Add a new test for normalized search (todo) --- test/pageTest.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/test/pageTest.php b/test/pageTest.php index 732505c..f3c6aa2 100644 --- a/test/pageTest.php +++ b/test/pageTest.php @@ -600,7 +600,6 @@ class PageTest extends PHPUnit_Framework_TestCase $qid = NULL; $n = "1"; - // Only books returned $currentPage = Page::getPage ($page, $qid, $query, $n); $currentPage->InitializeContent (); @@ -611,6 +610,25 @@ class PageTest extends PHPUnit_Framework_TestCase $this->assertFalse ($currentPage->ContainsBook ()); } + public function testPageSearch_WithNormalizedSearch () + { + global $config; + $page = Base::PAGE_OPENSEARCH_QUERY; + $query = "curee"; + $qid = NULL; + $n = "1"; + + $currentPage = Page::getPage ($page, $qid, $query, $n); + $currentPage->InitializeContent (); + + $this->markTestIncomplete(); + $this->assertEquals ("Search result for *curee*", $currentPage->title); + $this->assertCount (1, $currentPage->entryArray); + $this->assertEquals ("Search result for *curee* in books", $currentPage->entryArray [0]->title); + $this->assertEquals ("1 book", $currentPage->entryArray [0]->content); + $this->assertFalse ($currentPage->ContainsBook ()); + } + public function testPageSearchScopeAuthors () { $page = Base::PAGE_OPENSEARCH_QUERY;