From 39cf43cbc25f8e5ef2c0b421b6a451bbb635bbf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 26 Nov 2013 17:17:22 +0100 Subject: [PATCH] Add some test of base functions. re #96 --- test/baseTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/baseTest.php b/test/baseTest.php index 7b2c21c..423930d 100644 --- a/test/baseTest.php +++ b/test/baseTest.php @@ -42,4 +42,19 @@ class BaseTest extends PHPUnit_Framework_TestCase $_SERVER['HTTP_ACCEPT_LANGUAGE'] = "en"; localize ("authors.title", -1, true); } + + public function testBaseFunction () { + global $config; + + $this->assertFalse (Base::isMultipleDatabaseEnabled ()); + $this->assertEquals (array ("" => dirname(__FILE__) . "/BaseWithSomeBooks/"), Base::getDbList ()); + + $config['calibre_directory'] = array ("Some books" => dirname(__FILE__) . "/BaseWithSomeBooks/", + "One book" => dirname(__FILE__) . "/BaseWithOneBook/"); + + $this->assertTrue (Base::isMultipleDatabaseEnabled ()); + $this->assertEquals ("Some books", Base::getDbName (0)); + $this->assertEquals ("One book", Base::getDbName (1)); + $this->assertEquals ($config['calibre_directory'], Base::getDbList ()); + } } \ No newline at end of file