Integrate a little better the typeahead search in the normal search page. Heavily based on At-Libitum work. re #34

This commit is contained in:
Sébastien Lucas 2013-12-22 18:40:03 +01:00
parent ebbd830a33
commit 9a15d0e1a4
4 changed files with 122 additions and 92 deletions

View file

@ -277,10 +277,10 @@ class BookTest extends PHPUnit_Framework_TestCase
$this->assertEquals ("Lewis Carroll/Alice's Adventures in Wonderland (17)/Alice's Adventures in Wonderland - Lewis Carroll.epub", $book->getFilePath ("epub", 20, true));
$this->assertEquals ("Lewis Carroll/Alice's Adventures in Wonderland (17)/Alice's Adventures in Wonderland - Lewis Carroll.mobi", $book->getFilePath ("mobi", 17, true));
}
public function testGetDataFormat () {
$book = Book::getBookById(17);
// Get Alice MOBI=>17, PDF=>19, EPUB=>20
$data = $book->getDataFormat ("EPUB");
$this->assertEquals (20, $data->id);
@ -288,12 +288,13 @@ class BookTest extends PHPUnit_Framework_TestCase
$this->assertEquals (17, $data->id);
$data = $book->getDataFormat ("PDF");
$this->assertEquals (19, $data->id);
$this->assertNull ($book->getDataFormat ("FB2"));
}
public function testTypeaheadSearch ()
{
$_GET["page"] = Base::PAGE_OPENSEARCH_QUERY;
$_GET["query"] = "fic";
$_GET["search"] = "1";
@ -343,6 +344,7 @@ class BookTest extends PHPUnit_Framework_TestCase
public function testTypeaheadSearchMultiDatabase ()
{
global $config;
$_GET["page"] = Base::PAGE_OPENSEARCH_QUERY;
$_GET["query"] = "art";
$_GET["search"] = "1";
$_GET["multi"] = "1";