Merge
This commit is contained in:
커밋
23282ed1e8
1개의 변경된 파일과 63개의 추가작업 그리고 0개의 파일을 삭제
|
|
@ -44,6 +44,7 @@ class OpdsTest extends PHPUnit_Framework_TestCase
|
|||
$database = NULL;
|
||||
|
||||
$_SERVER['QUERY_STRING'] = "";
|
||||
$config['cops_subtitle_default'] = "My subtitle";
|
||||
|
||||
$currentPage = Page::getPage ($page, $qid, $query, $n);
|
||||
$currentPage->InitializeContent ();
|
||||
|
|
@ -58,4 +59,66 @@ class OpdsTest extends PHPUnit_Framework_TestCase
|
|||
$_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;
|
||||
|
||||
}
|
||||
}
|
||||
불러오는 중…
테이블 추가
Add a link
Reference in a new issue