Merge git://github.com/seblucas/cops
Conflicts: test/pageTest.php - RESOLVED
This commit is contained in:
commit
f87963ea8a
17 changed files with 337 additions and 36 deletions
|
@ -118,6 +118,7 @@ class BookTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
// All books by first letter
|
||||
list ($entryArray, $totalNumber) = Book::getBooksByStartingLetter ("T", -1);
|
||||
$this->assertEquals (-1, $totalNumber);
|
||||
$this->assertCount (3, $entryArray);
|
||||
}
|
||||
|
||||
|
@ -200,4 +201,30 @@ class BookTest extends PHPUnit_Framework_TestCase
|
|||
$_GET["search"] = NULL;
|
||||
}
|
||||
|
||||
public function testTypeaheadSearchMultiDatabase ()
|
||||
{
|
||||
global $config;
|
||||
$_GET["query"] = "art";
|
||||
$_GET["search"] = "1";
|
||||
$_GET["multi"] = "1";
|
||||
|
||||
$config['calibre_directory'] = array ("Some books" => dirname(__FILE__) . "/BaseWithSomeBooks/",
|
||||
"One book" => dirname(__FILE__) . "/BaseWithOneBook/");
|
||||
|
||||
$array = getJson ();
|
||||
|
||||
$this->assertCount (4, $array);
|
||||
$this->assertEquals ("Some books", $array[0]["title"]);
|
||||
$this->assertEquals ("No book", $array[1]["title"]);
|
||||
$this->assertEquals ("One book", $array[2]["title"]);
|
||||
$this->assertEquals ("1 book", $array[3]["title"]);
|
||||
|
||||
$_GET["query"] = NULL;
|
||||
$_GET["search"] = NULL;
|
||||
}
|
||||
|
||||
public function tearDown () {
|
||||
Base::clearDb ();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue