jenkins-bot has submitted this change and it was merged.

Change subject: Make ApiCreateAccount return camelcase statuses
......................................................................


Make ApiCreateAccount return camelcase statuses

Bug: 61663
Change-Id: I214d8eb7c9d49f55f49c5228c92806601c5499f6
---
M includes/api/ApiCreateAccount.php
M tests/phpunit/includes/api/ApiCreateAccountTest.php
2 files changed, 8 insertions(+), 8 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/api/ApiCreateAccount.php 
b/includes/api/ApiCreateAccount.php
index 7727b28..be8286c 100644
--- a/includes/api/ApiCreateAccount.php
+++ b/includes/api/ApiCreateAccount.php
@@ -138,13 +138,13 @@
                        // since not having the correct token is part of the 
normal
                        // flow of events.
                        $result['token'] = LoginForm::getCreateaccountToken();
-                       $result['result'] = 'needtoken';
+                       $result['result'] = 'NeedToken';
                } elseif ( !$status->isOK() ) {
                        // There was an error. Die now.
                        $this->dieStatus( $status );
                } elseif ( !$status->isGood() ) {
                        // Status is not good, but OK. This means warnings.
-                       $result['result'] = 'warning';
+                       $result['result'] = 'Warning';
 
                        // Add any warnings to the result
                        $warnings = $status->getErrorsByType( 'warning' );
@@ -157,7 +157,7 @@
                        }
                } else {
                        // Everything was fine.
-                       $result['result'] = 'success';
+                       $result['result'] = 'Success';
                }
 
                // Give extensions a chance to modify the API result data
@@ -229,9 +229,9 @@
                        'createaccount' => array(
                                'result' => array(
                                        ApiBase::PROP_TYPE => array(
-                                               'success',
-                                               'warning',
-                                               'needtoken'
+                                               'Success',
+                                               'Warning',
+                                               'NeedToken'
                                        )
                                ),
                                'username' => array(
diff --git a/tests/phpunit/includes/api/ApiCreateAccountTest.php 
b/tests/phpunit/includes/api/ApiCreateAccountTest.php
index a723245..8d134f7 100644
--- a/tests/phpunit/includes/api/ApiCreateAccountTest.php
+++ b/tests/phpunit/includes/api/ApiCreateAccountTest.php
@@ -45,7 +45,7 @@
 
                // Should first ask for token.
                $a = $result['createaccount'];
-               $this->assertEquals( 'needtoken', $a['result'] );
+               $this->assertEquals( 'NeedToken', $a['result'] );
                $token = $a['token'];
 
                // Finally create the account
@@ -63,7 +63,7 @@
 
                $result = $ret[0];
                $this->assertNotInternalType( 'bool', $result );
-               $this->assertEquals( 'success', 
$result['createaccount']['result'] );
+               $this->assertEquals( 'Success', 
$result['createaccount']['result'] );
 
                // Try logging in with the new user.
                $ret = $this->doApiRequest( array(

-- 
To view, visit https://gerrit.wikimedia.org/r/114473
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I214d8eb7c9d49f55f49c5228c92806601c5499f6
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <yuvipa...@gmail.com>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: Yurik <yu...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to