tests PAGE_SIZE

This commit is contained in:
Martin Monperrus
2015-11-19 21:46:34 +01:00
parent 24aa65d6a3
commit 079b87de90
4 changed files with 254 additions and 7 deletions
+14
View File
@@ -251,6 +251,20 @@ class BTBTest extends PHPUnit_Framework_TestCase {
$this->assertEquals("\`a Book",$dis->getTitle());
}
function test_PagedDisplay() {
$PAGE_SIZE = 3;
bibtexbrowser_configure('BIBTEXBROWSER_DEFAULT_DISPLAY', 'PagedDisplay');
bibtexbrowser_configure('PAGE_SIZE', $PAGE_SIZE);
$_GET['bib'] = 'bibacid-utf8.bib';
$_GET['all'] = 1;
$d = new Dispatcher();
ob_start();
$d->main();
$content = "<div>".ob_get_flush()."</div>";
$xml = new SimpleXMLElement($content);
$result = $xml->xpath('//td[@class=\'bibref\']');
$this->assertEquals($PAGE_SIZE,count($result));
}
} // end class
?>