remove warning and refresh tests
This commit is contained in:
+4
-12
@@ -62,21 +62,13 @@ class SimpleDisplayExt extends SimpleDisplay {
|
|||||||
|
|
||||||
class BibtexbrowserTest extends PHPUnit_Framework_TestCase {
|
class BibtexbrowserTest extends PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
public function setUp():void
|
public function setUp():void {
|
||||||
{
|
|
||||||
// resetting the default link style
|
// resetting the default link style
|
||||||
bibtexbrowser_configure('BIBTEXBROWSER_LINK_STYLE','bib2links_default');
|
bibtexbrowser_configure('BIBTEXBROWSER_LINK_STYLE','bib2links_default');
|
||||||
bibtexbrowser_configure('ABBRV_TYPE','index');
|
bibtexbrowser_configure('ABBRV_TYPE','index');
|
||||||
bibtexbrowser_configure('BIBTEXBROWSER_USE_PROGRESSIVE_ENHANCEMENT', false);
|
bibtexbrowser_configure('BIBTEXBROWSER_USE_PROGRESSIVE_ENHANCEMENT', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_checkdoc() {
|
|
||||||
if(!is_file('gakowiki-syntax.php')) { return; }
|
|
||||||
if (!function_exists('gk_wiki2html')) { include('gakowiki-syntax.php'); }
|
|
||||||
$result = create_wiki_parser()->parse(file_get_contents('README.wiki'));
|
|
||||||
$this->assertEquals(1, strpos($result,"bibtexbrowser is a PHP script that creates publication lists from Bibtex files"));
|
|
||||||
}
|
|
||||||
|
|
||||||
function createDB() {
|
function createDB() {
|
||||||
return $this->_createDB("@book{aKey,title={A Book},author={Martin Monperrus},publisher={Springer},year=2009}\n"
|
return $this->_createDB("@book{aKey,title={A Book},author={Martin Monperrus},publisher={Springer},year=2009}\n"
|
||||||
."@book{aKey/withSlash,title={Slash Dangerous for web servers},author={Ap Ache},editor={Martin Monperrus},publisher={Springer},year=2010}\n"
|
."@book{aKey/withSlash,title={Slash Dangerous for web servers},author={Ap Ache},editor={Martin Monperrus},publisher={Springer},year=2010}\n"
|
||||||
@@ -99,7 +91,7 @@ class BibtexbrowserTest extends PHPUnit_Framework_TestCase {
|
|||||||
|
|
||||||
// default style
|
// default style
|
||||||
$this->assertEquals("A Book (Martin Monperrus), Springer, 2009. [bibtex]",strip_tags($first_entry->toHTML()));
|
$this->assertEquals("A Book (Martin Monperrus), Springer, 2009. [bibtex]",strip_tags($first_entry->toHTML()));
|
||||||
$this->assertEquals('<span itemscope="" itemtype="http://schema.org/ScholarlyArticle"><span class="bibtitle" itemprop="name">A Book</span> (<span class="bibauthor"><span itemprop="author" itemtype="http://schema.org/Person">Martin Monperrus</span></span>), <span class="bibpublisher">Springer</span>, <span itemprop="datePublished">2009</span>.<span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.btitle=A+Book&rft.genre=book&rft.pub=Springer&rfr_id=info%3Asid%2F%3Amybib.bib&rft.date=2009&rft.au=Martin+Monperrus"></span></span> <span class="bibmenu"><a class="biburl" title="aKey" href="bibtexbrowser.php?key=aKey&bib=inline">[bibtex]</a></span>',$first_entry->toHTML());
|
$this->assertEquals('<span itemscope="" itemtype="http://schema.org/ScholarlyArticle"><span class="bibtitle" itemprop="name">A Book</span> (<span class="bibauthor"><span itemprop="author" itemtype="http://schema.org/Person">Martin Monperrus</span></span>), <span class="bibpublisher">Springer</span>, <span itemprop="datePublished">2009</span>.<span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.btitle=A+Book&rft.genre=book&rft.pub=Springer&rft.date=2009&rft.au=Martin+Monperrus"></span></span> <span class="bibmenu"><a class="biburl" title="aKey" href="bibtexbrowser.php?key=aKey&bib=inline">[bibtex]</a></span>',$first_entry->toHTML());
|
||||||
|
|
||||||
// IEEE style
|
// IEEE style
|
||||||
bibtexbrowser_configure('BIBLIOGRAPHYSTYLE','JanosBibliographyStyle');
|
bibtexbrowser_configure('BIBLIOGRAPHYSTYLE','JanosBibliographyStyle');
|
||||||
@@ -135,7 +127,7 @@ class BibtexbrowserTest extends PHPUnit_Framework_TestCase {
|
|||||||
bibtexbrowser_configure('BIBLIOGRAPHYSTYLE','DefaultBibliographyStyle');
|
bibtexbrowser_configure('BIBLIOGRAPHYSTYLE','DefaultBibliographyStyle');
|
||||||
bibtexbrowser_configure('BIBTEXBROWSER_LINK_STYLE','nothing');
|
bibtexbrowser_configure('BIBTEXBROWSER_LINK_STYLE','nothing');
|
||||||
$this->assertEquals("An Article (Foo Bar and Jane Doe), In New Results, volume 5, 2009. ",strip_tags($first_entry->toHTML()));
|
$this->assertEquals("An Article (Foo Bar and Jane Doe), In New Results, volume 5, 2009. ",strip_tags($first_entry->toHTML()));
|
||||||
$this->assertEquals('<span itemscope="" itemtype="http://schema.org/ScholarlyArticle"><span class="bibtitle" itemprop="name">An Article</span> (<span class="bibauthor"><span itemprop="author" itemtype="http://schema.org/Person">Foo Bar</span> and <span itemprop="author" itemtype="http://schema.org/Person">Jane Doe</span></span>), <span class="bibbooktitle">In <span itemprop="isPartOf">New Results</span></span>, volume 5, <span itemprop="datePublished">2009</span>.<span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.atitle=An+Article&rft.jtitle=New+Results&rft.volume=5&rft.issue=&rft.pub=&rfr_id=info%3Asid%2F%3Amybib.bib&rft.date=2009&rft.au=Foo+Bar&rft.au=Jane+Doe"></span></span> ',$first_entry->toHTML());
|
$this->assertEquals('<span itemscope="" itemtype="http://schema.org/ScholarlyArticle"><span class="bibtitle" itemprop="name">An Article</span> (<span class="bibauthor"><span itemprop="author" itemtype="http://schema.org/Person">Foo Bar</span> and <span itemprop="author" itemtype="http://schema.org/Person">Jane Doe</span></span>), <span class="bibbooktitle">In <span itemprop="isPartOf">New Results</span></span>, volume 5, <span itemprop="datePublished">2009</span>.<span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.atitle=An+Article&rft.jtitle=New+Results&rft.volume=5&rft.issue=&rft.pub=&rft.date=2009&rft.au=Foo+Bar&rft.au=Jane+Doe"></span></span> ',$first_entry->toHTML());
|
||||||
|
|
||||||
// listing the CSS classes
|
// listing the CSS classes
|
||||||
$css_classes_before = $this->extract_css_classes($first_entry->toHTML());
|
$css_classes_before = $this->extract_css_classes($first_entry->toHTML());
|
||||||
@@ -154,7 +146,7 @@ class BibtexbrowserTest extends PHPUnit_Framework_TestCase {
|
|||||||
// changing the target
|
// changing the target
|
||||||
bibtexbrowser_configure('BIBLIOGRAPHYSTYLE','DefaultBibliographyStyle');
|
bibtexbrowser_configure('BIBLIOGRAPHYSTYLE','DefaultBibliographyStyle');
|
||||||
bibtexbrowser_configure('BIBTEXBROWSER_LINKS_TARGET','_top');
|
bibtexbrowser_configure('BIBTEXBROWSER_LINKS_TARGET','_top');
|
||||||
$this->assertEquals('<span itemscope="" itemtype="http://schema.org/ScholarlyArticle"><span class="bibtitle" itemprop="name">An Article</span> (<span class="bibauthor"><span itemprop="author" itemtype="http://schema.org/Person">Foo Bar</span> and <span itemprop="author" itemtype="http://schema.org/Person">Jane Doe</span></span>), <span class="bibbooktitle">In <span itemprop="isPartOf">New Results</span></span>, volume 5, <span itemprop="datePublished">2009</span>.<span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.atitle=An+Article&rft.jtitle=New+Results&rft.volume=5&rft.issue=&rft.pub=&rfr_id=info%3Asid%2F%3Amybib.bib&rft.date=2009&rft.au=Foo+Bar&rft.au=Jane+Doe"></span></span> ',$first_entry->toHTML());
|
$this->assertEquals('<span itemscope="" itemtype="http://schema.org/ScholarlyArticle"><span class="bibtitle" itemprop="name">An Article</span> (<span class="bibauthor"><span itemprop="author" itemtype="http://schema.org/Person">Foo Bar</span> and <span itemprop="author" itemtype="http://schema.org/Person">Jane Doe</span></span>), <span class="bibbooktitle">In <span itemprop="isPartOf">New Results</span></span>, volume 5, <span itemprop="datePublished">2009</span>.<span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.atitle=An+Article&rft.jtitle=New+Results&rft.volume=5&rft.issue=&rft.pub=&rft.date=2009&rft.au=Foo+Bar&rft.au=Jane+Doe"></span></span> ',$first_entry->toHTML());
|
||||||
|
|
||||||
// testing ABBRV_TYPE
|
// testing ABBRV_TYPE
|
||||||
bibtexbrowser_configure('ABBRV_TYPE','year');
|
bibtexbrowser_configure('ABBRV_TYPE','year');
|
||||||
|
|||||||
@@ -1955,7 +1955,9 @@ class BibEntry {
|
|||||||
|
|
||||||
// referrer, the id of a collection of objects
|
// referrer, the id of a collection of objects
|
||||||
// see also http://www.openurl.info/registry/docs/pdf/info-sid.pdf
|
// see also http://www.openurl.info/registry/docs/pdf/info-sid.pdf
|
||||||
|
if (@$_GET[Q_FILE] != null ) {
|
||||||
$url_parts[]='rfr_id='.s3988('info:sid/'.@$_SERVER['HTTP_HOST'].':'.basename(@$_GET[Q_FILE]));
|
$url_parts[]='rfr_id='.s3988('info:sid/'.@$_SERVER['HTTP_HOST'].':'.basename(@$_GET[Q_FILE]));
|
||||||
|
}
|
||||||
|
|
||||||
$url_parts[]='rft.date='.s3988($this->getYear());
|
$url_parts[]='rft.date='.s3988($this->getYear());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user