From c0920895ede58cf22c0b22828ddd6210e7154a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 4 Oct 2013 12:30:11 +0200 Subject: [PATCH] Again new tests. re #96 --- test/bookTest.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/test/bookTest.php b/test/bookTest.php index 562780d..c076ef2 100644 --- a/test/bookTest.php +++ b/test/bookTest.php @@ -87,9 +87,32 @@ class StackTest extends PHPUnit_Framework_TestCase public function testGetAllBooks () { // All books by first letter - $entryArray = Book::getAllBooks (1, -1); + $entryArray = Book::getAllBooks (); $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 () {