Merge
This commit is contained in:
commit
23282ed1e8
|
@ -44,6 +44,7 @@ class OpdsTest extends PHPUnit_Framework_TestCase
|
||||||
$database = NULL;
|
$database = NULL;
|
||||||
|
|
||||||
$_SERVER['QUERY_STRING'] = "";
|
$_SERVER['QUERY_STRING'] = "";
|
||||||
|
$config['cops_subtitle_default'] = "My subtitle";
|
||||||
|
|
||||||
$currentPage = Page::getPage ($page, $qid, $query, $n);
|
$currentPage = Page::getPage ($page, $qid, $query, $n);
|
||||||
$currentPage->InitializeContent ();
|
$currentPage->InitializeContent ();
|
||||||
|
@ -58,4 +59,66 @@ class OpdsTest extends PHPUnit_Framework_TestCase
|
||||||
$_SERVER['QUERY_STRING'] = NULL;
|
$_SERVER['QUERY_STRING'] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testPageIndexMultipleDatabase ()
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
$config['calibre_directory'] = array ("Some books" => dirname(__FILE__) . "/BaseWithSomeBooks/",
|
||||||
|
"One book" => dirname(__FILE__) . "/BaseWithOneBook/");
|
||||||
|
$page = Base::PAGE_AUTHOR_DETAIL;
|
||||||
|
$query = NULL;
|
||||||
|
$search = NULL;
|
||||||
|
$qid = "1";
|
||||||
|
$n = "1";
|
||||||
|
$database = NULL;
|
||||||
|
$_SERVER['QUERY_STRING'] = "page=" . Base::PAGE_AUTHOR_DETAIL . "&id=1";
|
||||||
|
$_GET ["db"] = "0";
|
||||||
|
|
||||||
|
$currentPage = Page::getPage ($page, $qid, $query, $n);
|
||||||
|
$currentPage->InitializeContent ();
|
||||||
|
|
||||||
|
$OPDSRender = new OPDSRenderer ();
|
||||||
|
|
||||||
|
file_put_contents (TEST_FEED, $OPDSRender->render ($currentPage));
|
||||||
|
$this->AssertTrue ($this->opdsValidateSchema (TEST_FEED));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testPageAuthorsDetail ()
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
$page = Base::PAGE_AUTHOR_DETAIL;
|
||||||
|
$query = NULL;
|
||||||
|
$search = NULL;
|
||||||
|
$qid = "1";
|
||||||
|
$n = "1";
|
||||||
|
$database = NULL;
|
||||||
|
$_SERVER['QUERY_STRING'] = "page=" . Base::PAGE_AUTHOR_DETAIL . "&id=1&n=1";
|
||||||
|
|
||||||
|
$config['cops_max_item_per_page'] = 2;
|
||||||
|
$config['cops_books_filter'] = array ("Only Short Stories" => "Short Stories", "No Short Stories" => "!Short Stories");
|
||||||
|
|
||||||
|
// First page
|
||||||
|
|
||||||
|
$currentPage = Page::getPage ($page, $qid, $query, $n);
|
||||||
|
$currentPage->InitializeContent ();
|
||||||
|
|
||||||
|
$OPDSRender = new OPDSRenderer ();
|
||||||
|
|
||||||
|
file_put_contents (TEST_FEED, $OPDSRender->render ($currentPage));
|
||||||
|
$this->AssertTrue ($this->opdsValidateSchema (TEST_FEED));
|
||||||
|
|
||||||
|
// Second page
|
||||||
|
|
||||||
|
$n = 2;
|
||||||
|
$currentPage = Page::getPage ($page, $qid, $query, $n);
|
||||||
|
$currentPage->InitializeContent ();
|
||||||
|
|
||||||
|
$OPDSRender = new OPDSRenderer ();
|
||||||
|
|
||||||
|
file_put_contents (TEST_FEED, $OPDSRender->render ($currentPage));
|
||||||
|
$this->AssertTrue ($this->opdsValidateSchema (TEST_FEED));
|
||||||
|
|
||||||
|
// No pagination
|
||||||
|
$config['cops_max_item_per_page'] = -1;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue