From ecfc8f5e5c71c51a3bf443e309702f41fb8e374a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 3 Dec 2013 18:26:01 +0100 Subject: [PATCH] Add another test --- test/bookTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/bookTest.php b/test/bookTest.php index ed5537c..410e229 100644 --- a/test/bookTest.php +++ b/test/bookTest.php @@ -153,6 +153,20 @@ class BookTest extends PHPUnit_Framework_TestCase $this->assertEquals ("Strand Magazine", $book->getPublisher()->name); } + public function testGetMostInterestingDataToSendToKindle () + { + // Get Alice (available as MOBI, PDF, EPUB in that order) + $book = Book::getBookById(17); + $data = $book->GetMostInterestingDataToSendToKindle (); + $this->assertEquals ("MOBI", $data->format); + array_shift ($book->datas); + $data = $book->GetMostInterestingDataToSendToKindle (); + $this->assertEquals ("PDF", $data->format); + array_shift ($book->datas); + $data = $book->GetMostInterestingDataToSendToKindle (); + $this->assertEquals ("EPUB", $data->format); + } + public function testTypeaheadSearch () { $_GET["query"] = "fic";