fix various issues

This commit is contained in:
Martin Monperrus
2016-08-17 13:51:14 +02:00
parent b8ae783b52
commit cfe1af1f9b
4 changed files with 56 additions and 45 deletions
+8 -2
View File
@@ -21,6 +21,11 @@ error_reporting(E_ALL);
class BTBTest extends PHPUnit_Framework_TestCase {
function test_checkdoc() {
include('gakowiki-syntax.php');
create_wiki_parser()->parse(file_get_contents('bibtexbrowser-documentation.wiki'));
}
function createDB() {
$test_data = fopen('php://memory','x+');
fwrite($test_data, "@book{aKey,title={A Book},author={Martin Monperrus},publisher={Springer},year=2009}\n"
@@ -445,7 +450,7 @@ class BTBTest extends PHPUnit_Framework_TestCase {
$this->assertEquals("Meyer, Heribert and Foo Bar", $entry->getFormattedAuthorsString());
// Github issue 61
$bibtex = "@article{aKey61,title={An article Book},author = {Meyer, Heribert and {Advanced Air and Ground Research Team} and Foo Bar}}\n";
$bibtex = "@article{aKey61,title={An article Book},author = {Meyer, Heribert and {Advanced Air and Ground Research Team} and Foo Bar and J{\'e} Ko}}\n";
// wrong parsing of author names
$test_data = fopen('php://memory','x+');
fwrite($test_data, $bibtex);
@@ -454,10 +459,11 @@ class BTBTest extends PHPUnit_Framework_TestCase {
$db->update_internal("inline", $test_data);
$entry = $db->getEntryByKey('aKey61');
$authors = $entry->getRawAuthors();
$this->assertEquals(3, count($authors));
$this->assertEquals(4, count($authors));
$this->assertEquals("Meyer, Heribert", $authors[0]);
$this->assertEquals("Advanced Air and Ground Research Team", $authors[1]);
$this->assertEquals("Foo Bar", $authors[2]);
$this->assertEquals("Jé Ko", $authors[3]);
}
function test_latex2html() {