diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
commit | 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch) | |
tree | af68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /tests/phpunit/includes/api/ApiAccountCreationTest.php | |
parent | af4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff) |
Update to MediaWiki 1.22.0
Diffstat (limited to 'tests/phpunit/includes/api/ApiAccountCreationTest.php')
-rw-r--r-- | tests/phpunit/includes/api/ApiAccountCreationTest.php | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/tests/phpunit/includes/api/ApiAccountCreationTest.php b/tests/phpunit/includes/api/ApiAccountCreationTest.php index 94082e5a..68f80ac9 100644 --- a/tests/phpunit/includes/api/ApiAccountCreationTest.php +++ b/tests/phpunit/includes/api/ApiAccountCreationTest.php @@ -20,7 +20,7 @@ class ApiCreateAccountTest extends ApiTestCase { * a bit slow. Raise the default timeout. * @group medium */ - function testValid() { + public function testValid() { global $wgServer; if ( !isset( $wgServer ) ) { @@ -47,13 +47,16 @@ class ApiCreateAccountTest extends ApiTestCase { $token = $a['token']; // Finally create the account - $ret = $this->doApiRequest( array( - 'action' => 'createaccount', - 'name' => 'Apitestnew', - 'password' => $password, - 'token' => $token, - 'email' => 'test@domain.test', - 'realname' => 'Test Name' ), $ret[2] + $ret = $this->doApiRequest( + array( + 'action' => 'createaccount', + 'name' => 'Apitestnew', + 'password' => $password, + 'token' => $token, + 'email' => 'test@domain.test', + 'realname' => 'Test Name' + ), + $ret[2] ); $result = $ret[0]; @@ -65,8 +68,7 @@ class ApiCreateAccountTest extends ApiTestCase { 'action' => 'login', 'lgname' => 'Apitestnew', 'lgpassword' => $password, - ) - ); + ) ); $result = $ret[0]; $this->assertNotInternalType( 'bool', $result ); @@ -76,12 +78,14 @@ class ApiCreateAccountTest extends ApiTestCase { $this->assertEquals( 'NeedToken', $a ); $token = $result['login']['token']; - $ret = $this->doApiRequest( array( - 'action' => 'login', - 'lgtoken' => $token, - 'lgname' => 'Apitestnew', - 'lgpassword' => $password, - ), $ret[2] + $ret = $this->doApiRequest( + array( + 'action' => 'login', + 'lgtoken' => $token, + 'lgname' => 'Apitestnew', + 'lgpassword' => $password, + ), + $ret[2] ); $result = $ret[0]; @@ -92,9 +96,11 @@ class ApiCreateAccountTest extends ApiTestCase { $this->assertEquals( 'Success', $a ); // log out to destroy the session - $ret = $this->doApiRequest( array( - 'action' => 'logout', - ), $ret[2] + $ret = $this->doApiRequest( + array( + 'action' => 'logout', + ), + $ret[2] ); $this->assertEquals( array(), $ret[0] ); } @@ -103,8 +109,8 @@ class ApiCreateAccountTest extends ApiTestCase { * Make sure requests with no names are invalid. * @expectedException UsageException */ - function testNoName() { - $ret = $this->doApiRequest( array( + public function testNoName() { + $this->doApiRequest( array( 'action' => 'createaccount', 'token' => LoginForm::getCreateaccountToken(), 'password' => 'password', @@ -115,8 +121,8 @@ class ApiCreateAccountTest extends ApiTestCase { * Make sure requests with no password are invalid. * @expectedException UsageException */ - function testNoPassword() { - $ret = $this->doApiRequest( array( + public function testNoPassword() { + $this->doApiRequest( array( 'action' => 'createaccount', 'name' => 'testName', 'token' => LoginForm::getCreateaccountToken(), @@ -127,7 +133,7 @@ class ApiCreateAccountTest extends ApiTestCase { * Make sure requests with existing users are invalid. * @expectedException UsageException */ - function testExistingUser() { + public function testExistingUser() { $this->doApiRequest( array( 'action' => 'createaccount', 'name' => 'Apitestsysop', @@ -141,7 +147,7 @@ class ApiCreateAccountTest extends ApiTestCase { * Make sure requests with invalid emails are invalid. * @expectedException UsageException */ - function testInvalidEmail() { + public function testInvalidEmail() { $this->doApiRequest( array( 'action' => 'createaccount', 'name' => 'Test User', |