Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs that crash bot #553

Merged
merged 5 commits into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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