Skip to content

Commit

Permalink
simpler test out put
Browse files Browse the repository at this point in the history
  • Loading branch information
GlazerMann authored Jan 31, 2024
1 parent 7cc50e7 commit 307b3b1
Showing 1 changed file with 8 additions and 30 deletions.
38 changes: 8 additions & 30 deletions tests/phpunit/expandFnsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,6 @@ public function testHeaderProblemDOI() : void { // Just runs over the code and b
}

public function testHostIsGoneDOI() : void {
$changed = FALSE;
$should = "";
$nulls = "";
$both = "";
foreach (NULL_DOI_LIST as $doi) {
$this->assertSame(trim($doi), $doi);
}
Expand All @@ -385,43 +381,25 @@ public function testHostIsGoneDOI() : void {
foreach (NULL_DOI_BUT_GOOD as $doi) {
$this->assertSame(trim($doi), $doi);
}
$changes = "";
foreach (NULL_DOI_LIST as $doi) {
if (in_array($doi, NULL_DOI_BUT_GOOD)) {
$both = $both . " In Both: " . $doi . " ";
$changes = $changes . "In Both: " . $doi . " ";
}
$works = doi_works($doi);
sleep(1); // give dx.doi.org a break on this junk
if ($works === TRUE && !in_array($doi, NULL_DOI_ANNOYING)) {
$changed = TRUE;
} elseif ($works === FALSE) {
$should = $should . "'" . $doi . "',\n";
$changes = $changes . "Flagged as GOOD: " . $doi . " ";
} elseif ($works === NULL) { // These nulls are permanent and get mapped to FALSE
$should = $should . "'" . $doi . "',\n";
$nulls = $nulls . " This DOI is being flagged as NULL: " . $doi . " ";
$changes = $changes . "Flagged as NULL: " . $doi . " ";
}
}
foreach (NULL_DOI_ANNOYING as $doi) {
$this->assertTrue(in_array($doi, NULL_DOI_LIST));
}
if ($changed) {
$this->flush();
echo "\n\n" . $should . "\n\n";
$this->flush();
}
if ($nulls !== "") {
$this->flush();
echo "\n\n" . $nulls . "\n\n";
$this->flush();
}
if ($both !== "") {
$this->flush();
echo "\n\n" . $both . "\n\n";
$this->flush();
if (!in_array($doi, NULL_DOI_LIST)) {
$changes = $changes . "Not in main NULL list: " . $doi . " ";
}
}
$this->assertSame("", $nulls);
$this->assertSame("", $both);
$this->assertFalse($changed);
$this->assertSame("", $changes);
}

public function testBankruptDOICompany() : void {
Expand Down

0 comments on commit 307b3b1

Please sign in to comment.