Merge
This commit is contained in:
commit
236cfa95fb
BIN
test/BaseWithOneBook/metadata.db
Normal file
BIN
test/BaseWithOneBook/metadata.db
Normal file
Binary file not shown.
|
@ -1,10 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* COPS (Calibre OPDS PHP Server) test file
|
||||||
|
*
|
||||||
|
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
|
||||||
|
* @author Sébastien Lucas <sebastien@slucas.fr>
|
||||||
|
*/
|
||||||
|
|
||||||
require_once (dirname(__FILE__) . "/config_test.php");
|
require_once (dirname(__FILE__) . "/config_test.php");
|
||||||
require_once (dirname(__FILE__) . "/../book.php");
|
require_once (dirname(__FILE__) . "/../book.php");
|
||||||
require_once (dirname(__FILE__) . "/../OPDS_renderer.php");
|
require_once (dirname(__FILE__) . "/../OPDS_renderer.php");
|
||||||
|
|
||||||
define ("OPDS_RELAX_NG", dirname(__FILE__) . "/opds_catalog_1_1.rng");
|
define ("OPDS_RELAX_NG", dirname(__FILE__) . "/opds-relax-ng/opds_catalog_1_1.rng");
|
||||||
define ("JING_JAR", dirname(__FILE__) . "/jing.jar");
|
define ("JING_JAR", dirname(__FILE__) . "/jing.jar");
|
||||||
define ("TEST_FEED", dirname(__FILE__) . "/text.atom");
|
define ("TEST_FEED", dirname(__FILE__) . "/text.atom");
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* COPS (Calibre OPDS PHP Server) test file
|
||||||
|
*
|
||||||
|
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
|
||||||
|
* @author Sébastien Lucas <sebastien@slucas.fr>
|
||||||
|
*/
|
||||||
|
|
||||||
require_once (dirname(__FILE__) . "/config_test.php");
|
require_once (dirname(__FILE__) . "/config_test.php");
|
||||||
require_once (dirname(__FILE__) . "/../base.php");
|
require_once (dirname(__FILE__) . "/../base.php");
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* COPS (Calibre OPDS PHP Server) test file
|
||||||
|
*
|
||||||
|
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
|
||||||
|
* @author Sébastien Lucas <sebastien@slucas.fr>
|
||||||
|
*/
|
||||||
|
|
||||||
require_once (dirname(__FILE__) . "/config_test.php");
|
require_once (dirname(__FILE__) . "/config_test.php");
|
||||||
require_once (dirname(__FILE__) . "/../book.php");
|
require_once (dirname(__FILE__) . "/../book.php");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once (dirname(__FILE__) . "/../config_default.php");
|
require_once (dirname(__FILE__) . "/../config_default.php");
|
||||||
$config['calibre_directory'] = dirname(__FILE__) . "/";
|
$config['calibre_directory'] = dirname(__FILE__) . "/BaseWithSomeBooks/";
|
37
test/pageMultidatabaseTest.php
Normal file
37
test/pageMultidatabaseTest.php
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* COPS (Calibre OPDS PHP Server) test file
|
||||||
|
*
|
||||||
|
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
|
||||||
|
* @author Sébastien Lucas <sebastien@slucas.fr>
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once (dirname(__FILE__) . "/config_test.php");
|
||||||
|
require_once (dirname(__FILE__) . "/../book.php");
|
||||||
|
|
||||||
|
class PageMultiDatabaseTest extends PHPUnit_Framework_TestCase
|
||||||
|
{
|
||||||
|
public function testPageIndex ()
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
$config['calibre_directory'] = array ("Some books" => dirname(__FILE__) . "/BaseWithSomeBooks/",
|
||||||
|
"One book" => dirname(__FILE__) . "/BaseWithOneBook/");
|
||||||
|
$page = Base::PAGE_INDEX;
|
||||||
|
$query = NULL;
|
||||||
|
$search = NULL;
|
||||||
|
$qid = NULL;
|
||||||
|
$n = "1";
|
||||||
|
$database = NULL;
|
||||||
|
|
||||||
|
$currentPage = Page::getPage ($page, $qid, $query, $n);
|
||||||
|
$currentPage->InitializeContent ();
|
||||||
|
|
||||||
|
$this->assertEquals ($config['cops_title_default'], $currentPage->title);
|
||||||
|
$this->assertCount (2, $currentPage->entryArray);
|
||||||
|
$this->assertEquals ("Some books", $currentPage->entryArray [0]->title);
|
||||||
|
$this->assertEquals ("14 books", $currentPage->entryArray [0]->content);
|
||||||
|
$this->assertEquals ("One book", $currentPage->entryArray [1]->title);
|
||||||
|
$this->assertEquals ("1 book", $currentPage->entryArray [1]->content);
|
||||||
|
$this->assertFalse ($currentPage->ContainsBook ());
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* COPS (Calibre OPDS PHP Server) test file
|
||||||
|
*
|
||||||
|
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
|
||||||
|
* @author Sébastien Lucas <sebastien@slucas.fr>
|
||||||
|
*/
|
||||||
|
|
||||||
require_once (dirname(__FILE__) . "/config_test.php");
|
require_once (dirname(__FILE__) . "/config_test.php");
|
||||||
require_once (dirname(__FILE__) . "/../book.php");
|
require_once (dirname(__FILE__) . "/../book.php");
|
||||||
|
|
Loading…
Reference in a new issue