MediaWiki  1.23.8
ApiOptionsTest Class Reference

@group API @group Database @group medium More...

Inheritance diagram for ApiOptionsTest:
Collaboration diagram for ApiOptionsTest:

Public Member Functions

 getOptionKinds (IContextSource $context, $options=null)
 
 hookGetPreferences ( $user, &$preferences)
 
 testAnon ()
 
 testChange ()
 
 testMultiSelect ()
 
 testNoChanges ()
 
 testNoOptionname ()
 
 testNoToken ()
 @expectedException UsageException More...
 
 testOptionResetValue ()
 
 testOptionWithValue ()
 
 testReset ()
 
 testResetChangeOption ()
 
 testResetKinds ()
 
 testSpecialOption ()
 
 testUnknownOption ()
 
 testUserjsOption ()
 
- Public Member Functions inherited from MediaWikiTestCase
 __call ( $func, $args)
 
 __construct ( $name=null, array $data=array(), $dataName='')
 
 addDBData ()
 Stub. More...
 
 dbPrefix ()
 
 getCliArg ( $offset)
 
 hideDeprecated ( $function)
 Don't throw a warning if $function is deprecated and called later. More...
 
 needsDB ()
 
 run (PHPUnit_Framework_TestResult $result=null)
 
 setCliArg ( $offset, $value)
 
 testMediaWikiTestCaseParentSetupCalled ()
 Make sure MediaWikiTestCase extending classes have called their parent setUp method. More...
 
 usesTemporaryTables ()
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 
- Protected Member Functions inherited from MediaWikiTestCase
 arrayWrap (array $elements)
 Utility method taking an array of elements and wrapping each element in it's own array. More...
 
 assertArrayEquals (array $expected, array $actual, $ordered=false, $named=false)
 Assert that two arrays are equal. More...
 
 assertException ( $code, $expected='Exception', $message='')
 Asserts that an exception of the specified type occurs when running the provided code. More...
 
 assertHTMLEquals ( $expected, $actual, $msg='')
 Put each HTML element on its own line and then equals() the results. More...
 
 assertSelect ( $table, $fields, $condition, array $expectedRows)
 Asserts that the given database query yields the rows given by $expectedRows. More...
 
 assertType ( $type, $actual, $message='')
 Asserts the type of the provided value. More...
 
 assertTypeOrValue ( $type, $actual, $value=false, $message='')
 Asserts that the provided variable is of the specified internal type or equals the $value argument. More...
 
 assertValidHtmlDocument ( $html)
 Asserts that the given string is valid HTML document. More...
 
 assertValidHtmlSnippet ( $html)
 Asserts that the given string is a valid HTML snippet. More...
 
 checkDbIsSupported ()
 
 checkHasDiff3 ()
 Check, if $wgDiff3 is set and ready to merge Will mark the calling test as skipped, if not ready. More...
 
 checkHasGzip ()
 Check whether we have the 'gzip' commandline utility, will skip the test whenever "gzip -V" fails. More...
 
 checkPHPExtension ( $extName)
 Check if $extName is a loaded PHP extension, will skip the test whenever it is not loaded. More...
 
 getDefaultWikitextNS ()
 Returns the ID of a namespace that defaults to Wikitext. More...
 
 getNewTempDirectory ()
 obtains a new temporary directory More...
 
 getNewTempFile ()
 Obtains a new temporary file name. More...
 
 isWikitextNS ( $ns)
 Returns true if the given namespace defaults to Wikitext according to $wgNamespaceContentModels. More...
 
 mergeMwGlobalArrayValue ( $name, $values)
 Merges the given values into a MW global array variable. More...
 
 objectAssociativeSort (array &$array)
 Does an associative sort that works for objects. More...
 
 setMwGlobals ( $pairs, $value=null)
 
 stashMwGlobals ( $globalKeys)
 Stashes the global, will be restored in tearDown() More...
 

Private Member Functions

 executeQuery ( $request)
 
 getSampleRequest ( $custom=array())
 

Private Attributes

DerivativeContext $mContext
 
 $mOldGetPreferencesHooks = false
 
 $mSession
 
ApiOptions $mTested
 
PHPUnit_Framework_MockObject_MockObject $mUserMock
 

Static Private Attributes

static $Success = array( 'options' => 'success' )
 

Additional Inherited Members

- Static Public Member Functions inherited from MediaWikiTestCase
static listTables ( $db)
 
static setupTestDB (DatabaseBase $db, $prefix)
 Creates an empty skeleton of the wiki database by cloning its structure to equivalent tables using the given $prefix. More...
 
static teardownTestDB ()
 Restores MediaWiki to using the table set (table prefix) it was using before setupTestDB() was called. More...
 
- Public Attributes inherited from MediaWikiTestCase
const DB_PREFIX = 'unittest_'
 Table name prefixes. More...
 
const ORA_DB_PREFIX = 'ut_'
 
- Static Public Attributes inherited from MediaWikiTestCase
static $users
 
- Static Protected Member Functions inherited from MediaWikiTestCase
static stripStringKeys (&$r)
 Utility function for eliminating all string keys from an array. More...
 
- Protected Attributes inherited from MediaWikiTestCase
DatabaseBase $db
 
array $supportedDBs
 
array $tablesUsed = array()
 

Detailed Description

@group API @group Database @group medium

@covers ApiOptions

Definition at line 10 of file ApiOptionsTest.php.

Member Function Documentation

◆ executeQuery()

◆ getOptionKinds()

ApiOptionsTest::getOptionKinds ( IContextSource  $context,
  $options = null 
)
Parameters
IContextSource$context
array | null$options
Returns
array

Definition at line 105 of file ApiOptionsTest.php.

References $options, $value, array(), and as.

◆ getSampleRequest()

◆ hookGetPreferences()

ApiOptionsTest::hookGetPreferences (   $user,
$preferences 
)

Definition at line 69 of file ApiOptionsTest.php.

References array(), and as.

◆ setUp()

ApiOptionsTest::setUp ( )
protected

Reimplemented from MediaWikiLangTestCase.

Definition at line 21 of file ApiOptionsTest.php.

References $wgHooks, array(), global, and Title\newFromText().

◆ tearDown()

ApiOptionsTest::tearDown ( )
protected

Reimplemented from MediaWikiTestCase.

Definition at line 58 of file ApiOptionsTest.php.

References $mOldGetPreferencesHooks, $wgHooks, and global.

◆ testAnon()

ApiOptionsTest::testAnon ( )

Definition at line 164 of file ApiOptionsTest.php.

References $e, executeQuery(), fail, and getSampleRequest().

◆ testChange()

ApiOptionsTest::testChange ( )

Definition at line 290 of file ApiOptionsTest.php.

References $response, array(), executeQuery(), and getSampleRequest().

◆ testMultiSelect()

ApiOptionsTest::testMultiSelect ( )

Definition at line 358 of file ApiOptionsTest.php.

References $response, array(), executeQuery(), and getSampleRequest().

◆ testNoChanges()

ApiOptionsTest::testNoChanges ( )

Definition at line 196 of file ApiOptionsTest.php.

References $e, executeQuery(), fail, and getSampleRequest().

◆ testNoOptionname()

ApiOptionsTest::testNoOptionname ( )

Definition at line 182 of file ApiOptionsTest.php.

References $e, array(), executeQuery(), fail, and getSampleRequest().

◆ testNoToken()

ApiOptionsTest::testNoToken ( )

@expectedException UsageException

Definition at line 158 of file ApiOptionsTest.php.

References array(), executeQuery(), and getSampleRequest().

◆ testOptionResetValue()

ApiOptionsTest::testOptionResetValue ( )

Definition at line 273 of file ApiOptionsTest.php.

References $response, array(), executeQuery(), and getSampleRequest().

◆ testOptionWithValue()

ApiOptionsTest::testOptionWithValue ( )

Definition at line 255 of file ApiOptionsTest.php.

References $response, array(), executeQuery(), and getSampleRequest().

◆ testReset()

ApiOptionsTest::testReset ( )

Definition at line 219 of file ApiOptionsTest.php.

References $response, array(), executeQuery(), and getSampleRequest().

◆ testResetChangeOption()

ApiOptionsTest::testResetChangeOption ( )

Definition at line 325 of file ApiOptionsTest.php.

References $args, $response, array(), executeQuery(), and getSampleRequest().

◆ testResetKinds()

ApiOptionsTest::testResetKinds ( )

Definition at line 237 of file ApiOptionsTest.php.

References $response, array(), executeQuery(), and getSampleRequest().

◆ testSpecialOption()

ApiOptionsTest::testSpecialOption ( )

Definition at line 390 of file ApiOptionsTest.php.

References $response, array(), executeQuery(), and getSampleRequest().

◆ testUnknownOption()

ApiOptionsTest::testUnknownOption ( )

Definition at line 413 of file ApiOptionsTest.php.

References $response, array(), executeQuery(), and getSampleRequest().

◆ testUserjsOption()

ApiOptionsTest::testUserjsOption ( )

Definition at line 436 of file ApiOptionsTest.php.

References $response, array(), executeQuery(), and getSampleRequest().

Member Data Documentation

◆ $mContext

DerivativeContext ApiOptionsTest::$mContext
private

Definition at line 15 of file ApiOptionsTest.php.

◆ $mOldGetPreferencesHooks

ApiOptionsTest::$mOldGetPreferencesHooks = false
private

Definition at line 17 of file ApiOptionsTest.php.

Referenced by tearDown().

◆ $mSession

ApiOptionsTest::$mSession
private

Definition at line 14 of file ApiOptionsTest.php.

◆ $mTested

ApiOptions ApiOptionsTest::$mTested
private

Definition at line 13 of file ApiOptionsTest.php.

◆ $mUserMock

PHPUnit_Framework_MockObject_MockObject ApiOptionsTest::$mUserMock
private

Definition at line 12 of file ApiOptionsTest.php.

◆ $Success

ApiOptionsTest::$Success = array( 'options' => 'success' )
staticprivate

Definition at line 19 of file ApiOptionsTest.php.


The documentation for this class was generated from the following file: