MediaWiki  1.23.13
ApiTokensTest.php
Go to the documentation of this file.
1 <?php
2 
10 class ApiTokensTest extends ApiTestCase {
11 
12  public function testGettingToken() {
13  foreach ( self::$users as $user ) {
14  $this->runTokenTest( $user );
15  }
16  }
17 
18  protected function runTokenTest( $user ) {
19  $tokens = $this->getTokenList( $user );
20 
21  $rights = $user->user->getRights();
22 
23  $this->assertArrayHasKey( 'edittoken', $tokens );
24  $this->assertArrayHasKey( 'movetoken', $tokens );
25 
26  if ( isset( $rights['delete'] ) ) {
27  $this->assertArrayHasKey( 'deletetoken', $tokens );
28  }
29 
30  if ( isset( $rights['block'] ) ) {
31  $this->assertArrayHasKey( 'blocktoken', $tokens );
32  $this->assertArrayHasKey( 'unblocktoken', $tokens );
33  }
34 
35  if ( isset( $rights['protect'] ) ) {
36  $this->assertArrayHasKey( 'protecttoken', $tokens );
37  }
38  }
39 
40 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
ApiTestCase\getTokenList
getTokenList( $user, $session=null)
Definition: ApiTestCase.php:166
ApiTestCase
Definition: ApiTestCase.php:3
ApiTokensTest\testGettingToken
testGettingToken()
Definition: ApiTokensTest.php:12
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:237
ApiTokensTest\runTokenTest
runTokenTest( $user)
Definition: ApiTokensTest.php:18
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
ApiTokensTest
@group API @group Database @group medium
Definition: ApiTokensTest.php:10