diff --git a/tests/phpunit/TemplateTest.php b/tests/phpunit/TemplateTest.php index 03fd2abeee..aa75f114ac 100644 --- a/tests/phpunit/TemplateTest.php +++ b/tests/phpunit/TemplateTest.php @@ -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')); } @@ -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')); } diff --git a/tests/phpunit/zoteroTest.php b/tests/phpunit/zoteroTest.php index 795dede523..bf3ab716b4 100644 --- a/tests/phpunit/zoteroTest.php +++ b/tests/phpunit/zoteroTest.php @@ -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')); } @@ -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')));