From 73277af6f44ae9ffe79051788be5b8c6609d553e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sun, 15 Dec 2013 15:08:20 +0100 Subject: [PATCH] Another test. re #127 --- test/bookTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/bookTest.php b/test/bookTest.php index 962186b..29bd02f 100644 --- a/test/bookTest.php +++ b/test/bookTest.php @@ -277,6 +277,20 @@ 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); + $data = $book->getDataFormat ("MOBI"); + $this->assertEquals (17, $data->id); + $data = $book->getDataFormat ("PDF"); + $this->assertEquals (19, $data->id); + + $this->assertNull ($book->getDataFormat ("FB2")); + } public function testTypeaheadSearch () {