Again new tests. re #96

This commit is contained in:
Sébastien Lucas 2013-10-04 12:30:11 +02:00
parent 9c09b8797c
commit c0920895ed

View file

@ -87,10 +87,33 @@ class StackTest extends PHPUnit_Framework_TestCase
public function testGetAllBooks () public function testGetAllBooks ()
{ {
// All books by first letter // All books by first letter
$entryArray = Book::getAllBooks (1, -1); $entryArray = Book::getAllBooks ();
$this->assertCount (9, $entryArray); $this->assertCount (9, $entryArray);
} }
public function testGetBooksByStartingLetter ()
{
// All books by first letter
list ($entryArray, $totalNumber) = Book::getBooksByStartingLetter ("T", -1);
$this->assertCount (3, $entryArray);
}
public function testGetAllRecentBooks ()
{
// All recent books
global $config;
$config['cops_recentbooks_limit'] = 2;
$entryArray = Book::getAllRecentBooks ();
$this->assertCount (2, $entryArray);
$config['cops_recentbooks_limit'] = 50;
$entryArray = Book::getAllRecentBooks ();
$this->assertCount (14, $entryArray);
}
public function testGetBookById () public function testGetBookById ()
{ {
// also check most of book's class methods // also check most of book's class methods