Fix a warning. re #127

This commit is contained in:
Sébastien Lucas 2013-12-24 11:36:05 +01:00
parent 906e792bb8
commit 09c81e50e8

View file

@ -33,7 +33,10 @@ class PageMultiDatabaseTest extends PHPUnit_Framework_TestCase
$this->assertFalse ($currentPage->ContainsBook ()); $this->assertFalse ($currentPage->ContainsBook ());
} }
public function testPageSearchXXX () /**
* @dataProvider providerSearch
*/
public function testPageSearchXXX ($maxItem)
{ {
global $config; global $config;
$config['calibre_directory'] = array ("Some books" => dirname(__FILE__) . "/BaseWithSomeBooks/", $config['calibre_directory'] = array ("Some books" => dirname(__FILE__) . "/BaseWithSomeBooks/",
@ -44,7 +47,7 @@ class PageMultiDatabaseTest extends PHPUnit_Framework_TestCase
$n = "1"; $n = "1";
// Issue 124 // Issue 124
$config['cops_max_item_per_page'] = 2; $config['cops_max_item_per_page'] = $maxItem;
$currentPage = Page::getPage ($page, $qid, $query, $n); $currentPage = Page::getPage ($page, $qid, $query, $n);
$currentPage->InitializeContent (); $currentPage->InitializeContent ();
@ -56,18 +59,14 @@ class PageMultiDatabaseTest extends PHPUnit_Framework_TestCase
$this->assertEquals ("One book", $currentPage->entryArray [1]->title); $this->assertEquals ("One book", $currentPage->entryArray [1]->title);
$this->assertEquals ("1 book", $currentPage->entryArray [1]->content); $this->assertEquals ("1 book", $currentPage->entryArray [1]->content);
$this->assertFalse ($currentPage->ContainsBook ()); $this->assertFalse ($currentPage->ContainsBook ());
}
$config['cops_max_item_per_page'] = -1;
$currentPage = Page::getPage ($page, $qid, $query, $n); public function providerSearch ()
$currentPage->InitializeContent (); {
return array (
$this->assertEquals ("Search result for *art*", $currentPage->title); array (2),
$this->assertCount (2, $currentPage->entryArray); array (-1)
$this->assertEquals ("Some books", $currentPage->entryArray [0]->title); );
$this->assertEquals ("10 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 ());
} }
public static function tearDownAfterClass () { public static function tearDownAfterClass () {