Add some test of base functions. re #96

This commit is contained in:
Sébastien Lucas 2013-11-26 17:17:22 +01:00
parent 6029355085
commit 39cf43cbc2

View file

@ -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 ());
}
}