Skip to content

Commit

Permalink
Fix bugs that crash bot (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
josve05a authored and GlazerMann committed Feb 25, 2019
1 parent 9b07de8 commit dc306db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions expandFns.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
require_once("Comment.php");
require_once("wikiFunctions.php");
require_once("user_messages.php");
require_once("WikipediaBot.php");

$api_files = glob('api_handlers/*.php');
foreach ($api_files as $file) {
Expand Down
18 changes: 9 additions & 9 deletions tests/phpunit/DOIToolsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,47 +45,47 @@ public function testFormatMultipleAuthors7() { // The word "and"

public function testFormatAuthor1() {
$author = "Conway Morris S.C.";
$result=format_author($author,FALSE);
$result=format_author($author);
$this->assertEquals('Conway Morris, S.C.', $result); // Was c, Conway Morris S
}
public function testFormatAuthor2() {
$author = "M.A. Smith";
$result=format_author($author,FALSE);
$result=format_author($author);
$this->assertEquals('Smith, M.A', $result);
}
public function testFormatAuthor3() {
$author = "Smith M.A.";
$result=format_author($author,FALSE);
$result=format_author($author);
$this->assertEquals('Smith, M.A.', $result); // Was a, Smith M
}
public function testFormatAuthor4() {
$author = "Smith MA.";
$result=format_author($author,FALSE);
$result=format_author($author);
$this->assertEquals('Smith, M.A.', $result);
}
public function testFormatAuthor5() {
$author = "Martin A. Smith";
$result=format_author($author,FALSE);
$result=format_author($author);
$this->assertEquals('Smith, Martin A', $result);
}
public function testFormatAuthor6() {
$author = "MA Smith";
$result=format_author($author,FALSE);
$result=format_author($author);
$this->assertEquals('Smith, M.A.', $result);
}
public function testFormatAuthor7() {
$author = "Martin Smith";
$result=format_author($author,FALSE);
$result=format_author($author);
$this->assertEquals('Smith, Martin', $result);
}
public function testFormatAuthor8() {
$author = "Conway Morris S.C..";
$result=format_author($author,FALSE);
$result=format_author($author);
$this->assertEquals('Conway Morris, S.C.', $result); //Was c, Conway Morris S
}
public function testFormatAuthor9() {
$author = "Smith MA";
$result=format_author($author,FALSE);
$result=format_author($author);
$this->assertEquals('Smith, M.A.', $result);
}

Expand Down

0 comments on commit dc306db

Please sign in to comment.