From 6029355085f88c2893d3c47817d00648050e61e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 26 Nov 2013 17:01:57 +0100 Subject: [PATCH] Add a new test. re #96 --- test/pageMultidatabaseTest.php | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/test/pageMultidatabaseTest.php b/test/pageMultidatabaseTest.php index 69d8df6..59511e2 100644 --- a/test/pageMultidatabaseTest.php +++ b/test/pageMultidatabaseTest.php @@ -34,4 +34,33 @@ class PageMultiDatabaseTest extends PHPUnit_Framework_TestCase $this->assertEquals ("1 book", $currentPage->entryArray [1]->content); $this->assertFalse ($currentPage->ContainsBook ()); } -} \ No newline at end of file + + public function testPageSearchXXX () + { + global $config; + $config['calibre_directory'] = array ("Some books" => dirname(__FILE__) . "/BaseWithSomeBooks/", + "One book" => dirname(__FILE__) . "/BaseWithOneBook/"); + $page = Base::PAGE_OPENSEARCH_QUERY; + $query = "art"; + $search = NULL; + $qid = NULL; + $n = "1"; + $database = NULL; + + $currentPage = Page::getPage ($page, $qid, $query, $n); + $currentPage->InitializeContent (); + + $this->assertEquals ("Search result for *art*", $currentPage->title); + $this->assertCount (2, $currentPage->entryArray); + $this->assertEquals ("Some books", $currentPage->entryArray [0]->title); + $this->assertEquals ("10 books", $currentPage->entryArray [0]->content); + $this->assertEquals ("One book", $currentPage->entryArray [1]->title); + $this->assertEquals ("1 book", $currentPage->entryArray [1]->content); + $this->assertFalse ($currentPage->ContainsBook ()); + } + + public static function tearDownAfterClass () { + Base::clearDb (); + } + +}