fixes bug in generated hyperlinks. Closes #40.

This commit is contained in:
Martin Monperrus
2015-09-29 22:56:53 +02:00
parent f0674d94f9
commit 946798f41b
2 changed files with 25 additions and 1 deletions
+15
View File
@@ -193,6 +193,21 @@ class BTBTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('<a href="myarticle.pdf">[pdf]</a>',$first_entry->getUrlLink());
}
// https://github.com/monperrus/bibtexbrowser/issues/40
function test_doi_url() {
$test_data = fopen('php://memory','x+');
fwrite($test_data, "@Article{Baldwin2014Quantum,Doi={10.1103/PhysRevA.90.012110},Url={http://link.aps.org/doi/10.1103/PhysRevA.90.012110}}"
);
fseek($test_data,0);
$btb = new BibDataBase();
$btb->update_internal("inline", $test_data);
$first_entry=$btb->bibdb[array_keys($btb->bibdb)[0]];
$this->assertEquals('<pre class="purebibtex">@Article{Baldwin2014Quantum,Doi={<a href="http://dx.doi.org/10.1103/PhysRevA.90.012110">10.1103/PhysRevA.90.012110</a>},Url={<a href="http://link.aps.org/doi/10.1103/PhysRevA.90.012110">http://link.aps.org/doi/10.1103/PhysRevA.90.012110</a>}}</pre>',$first_entry->toEntryUnformatted());
}
} // end class
?>