From 3e592ebc81ae2bfb0fbea19d2251b116d72a1f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sun, 15 Dec 2013 14:44:10 +0100 Subject: [PATCH] Test getFilePath. re #127 --- test/bookTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/bookTest.php b/test/bookTest.php index 0e3c0ff..962186b 100644 --- a/test/bookTest.php +++ b/test/bookTest.php @@ -269,6 +269,15 @@ class BookTest extends PHPUnit_Framework_TestCase $this->assertEquals ("fetch.php?data=20&type=epub&id=17", $data->getHtmlLink ()); } + public function testGetFilePath () { + $book = Book::getBookById(17); + + $this->assertEquals ("Lewis Carroll/Alice's Adventures in Wonderland (17)/cover.jpg", $book->getFilePath ("jpg", NULL, true)); + + $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 testTypeaheadSearch () { $_GET["query"] = "fic";