Skip to content

Commit

Permalink
try do-over and some tests (#4385)
Browse files Browse the repository at this point in the history
  • Loading branch information
GlazerMann authored Jan 26, 2024
1 parent 1ebbe48 commit 119200a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tests/phpunit/TemplateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,10 @@ public function testRemoveWikilinks8() : void {

public function testJournalCapitalization1() : void {
$expanded = $this->process_citation("{{Cite journal|pmid=9858585}}");
if ($expanded->get2('journal') === "") {
sleep(5);
$expanded = $this->process_citation("{{Cite journal|pmid=9858585}}");
}
$this->assertSame('Molecular and Cellular Biology', $expanded->get2('journal'));
}

Expand Down Expand Up @@ -3742,6 +3746,11 @@ public function testJunkData() : void {
"{{Cite web | title=IEEE Xplore This is a title with Document|pmid=1974138}}" .
"{{Cite web | title=JSTOR This is a title document with Volume 3 and page 5|doi= 10.1021/jp101758y}}";
$page = $this->process_page($text);
if (substr_count($page->parsed_text(), 'JSTOR') !== 0) {
sleep(3);
$text = $page->parsed_text();
$page = $this->process_page($text);
}
$this->assertSame(0, substr_count($page->parsed_text(), 'JSTOR'));
}

Expand Down
10 changes: 9 additions & 1 deletion tests/phpunit/zoteroTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ public function testSimpleIEEE() : void {
public function testIEEEdoi() : void {
$url = "https://ieeexplore.ieee.org/document/4242344";
$template = $this->process_citation('{{cite journal | url = ' . $url . ' }}');
if ($template->get('doi') === "") {
sleep(5);
$template = $this->process_citation('{{cite journal | url = ' . $url . ' }}');
}
$this->assertSame('10.1109/ISSCC.2007.373373', $template->get2('doi'));
}

Expand Down Expand Up @@ -1051,7 +1055,11 @@ public function testZoteroExpansionNYT() : void {
$text = '{{Cite web|url=https://www.nytimes.com/2018/06/11/technology/net-neutrality-repeal.html}}';
$expanded = $this->expand_via_zotero($text);
if ($expanded->get('title') === "") {
sleep(2);
sleep(5);
$expanded = $this->expand_via_zotero($text);
}
if ($expanded->get('title') === "") {
sleep(5);
$expanded = $this->expand_via_zotero($text);
}
$this->assertSame("Net Neutrality Has Officially Been Repealed. Here's How That Could Affect You", str_replace('. (Published 2018)', '', $expanded->get('title')));
Expand Down

0 comments on commit 119200a

Please sign in to comment.