fixes bug introduced by 8fe8c897f

This commit is contained in:
Martin Monperrus
2016-04-05 16:26:22 +02:00
parent d6e0700503
commit 2bc740eb17
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -284,6 +284,19 @@ class BTBTest extends PHPUnit_Framework_TestCase {
$result = $xml->xpath('//td[@class=\'bibref\']');
$this->assertEquals($PAGE_SIZE,count($result));
}
function test_getKeywords() {
$bibtex = "@article{aKey,title={\`a Book},keywords={foo,bar},author={Martin Monperrus},publisher={Springer},year=2009,pages={42--4242},number=1}\n";
bibtexbrowser_configure('BIBTEXBROWSER_USE_LATEX2HTML', true);
$test_data = fopen('php://memory','x+');
fwrite($test_data, $bibtex);
fseek($test_data,0);
$db = new BibDataBase();
$db->update_internal("inline", $test_data);
$dis = $db->getEntryByKey('aKey');
$this->assertEquals(2,count($dis->getKeywords()));
}
} // end class
?>
+1 -1
View File
@@ -1492,7 +1492,7 @@ class BibEntry {
/** returns the array of keywords */
function getKeywords() {
return preg_split('/[,;\\/]/', $bib->getField("keywords"));
return preg_split('/[,;\\/]/', $this->getField("keywords"));
}
/** Returns the value of the given field? */