Add a new test. re #96
This commit is contained in:
parent
f7be2ce893
commit
6029355085
|
@ -34,4 +34,33 @@ class PageMultiDatabaseTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertEquals ("1 book", $currentPage->entryArray [1]->content);
|
||||
$this->assertFalse ($currentPage->ContainsBook ());
|
||||
}
|
||||
}
|
||||
|
||||
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 ();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue