Merge "Added some extra tests for ORMRow class"
[lhc/web/wiklou.git] / includes / api / ApiTokens.php
index 4a68826..2c9b482 100644 (file)
@@ -64,9 +64,9 @@ class ApiTokens extends ApiBase {
                wfProfileIn( __METHOD__ );
                $types = array( 'patrol' => 'ApiQueryRecentChanges::getPatrolToken' );
                $names = array( 'edit', 'delete', 'protect', 'move', 'block', 'unblock',
-                       'email', 'import', 'watch' );
+                       'email', 'import', 'watch', 'options' );
                foreach ( $names as $name ) {
-                       $types[$name] = 'ApiQUeryInfo::get' . ucfirst( $name ) . 'Token';
+                       $types[$name] = 'ApiQueryInfo::get' . ucfirst( $name ) . 'Token';
                }
                wfRunHooks( 'ApiTokensGetTokenTypes', array( &$types ) );
                ksort( $types );
@@ -84,6 +84,57 @@ class ApiTokens extends ApiBase {
                );
        }
 
+       public function getResultProperties() {
+               return array(
+                       '' => array(
+                               'patroltoken' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'edittoken' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'deletetoken' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'protecttoken' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'movetoken' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'blocktoken' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'unblocktoken' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'emailtoken' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'importtoken' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'watchtoken' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'optionstoken' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               )
+                       )
+               );
+       }
+
        public function getParamDescription() {
                return array(
                        'type' => 'Type of token(s) to request'