MediaWiki REL1_31
|
This file host two test case classes for the MediaWiki FormOptions class: More...
Public Member Functions | |
getOptions () | |
Public Member Functions inherited from FormOptions | |
offsetExists ( $name) | |
Whether the option exists. | |
offsetGet ( $name) | |
Retrieve an option value. | |
offsetSet ( $name, $value) | |
Set an option to given value. | |
offsetUnset ( $name) | |
Delete the option. | |
add ( $name, $default, $type=self::AUTO) | |
Add an option to be handled by this FormOptions instance. | |
delete ( $name) | |
Remove an option being handled by this FormOptions instance. | |
validateName ( $name, $strict=false) | |
Verify that the given option name exists. | |
setValue ( $name, $value, $force=false) | |
Use to set the value of an option. | |
getValue ( $name) | |
Get the value for the given option name. | |
reset ( $name) | |
Delete the option value. | |
consumeValue ( $name) | |
Get the value of given option and mark it as 'consumed'. | |
consumeValues ( $names) | |
Get the values of given options and mark them as 'consumed'. | |
validateIntBounds ( $name, $min, $max) | |
validateBounds ( $name, $min, $max) | |
Constrain a numeric value for a given option to a given range. | |
getUnconsumedValues ( $all=false) | |
Get all remaining values which have not been consumed by consumeValue() or consumeValues(). | |
getChangedValues () | |
Return options modified as an array ( name => value ) | |
getAllValues () | |
Format options to an array ( name => value ) | |
fetchValuesFromRequest (WebRequest $r, $optionKeys=null) | |
Fetch values for all options (or selected options) from the given WebRequest, making them available for accessing with getValue() or consumeValue() etc. | |
Additional Inherited Members | |
Static Public Member Functions inherited from FormOptions | |
static | guessType ( $data) |
Used to find out which type the data is. | |
Public Attributes inherited from FormOptions | |
const | AUTO = -1 |
Mark value for automatic detection (for simple data types only) | |
const | STRING = 0 |
String type, maps guessType() to WebRequest::getText() | |
const | INT = 1 |
Integer type, maps guessType() to WebRequest::getInt() | |
const | FLOAT = 4 |
Float type, maps guessType() to WebRequest::getFloat() | |
const | BOOL = 2 |
Boolean type, maps guessType() to WebRequest::getBool() | |
const | INTNULL = 3 |
Integer type or null, maps to WebRequest::getIntOrNull() This is useful for the namespace selector. | |
const | ARR = 5 |
Array type, maps guessType() to WebRequest::getArray() | |
Protected Member Functions inherited from FormOptions | |
getValueReal ( $option) | |
Return current option value, based on a structure taken from $options. | |
Protected Attributes inherited from FormOptions | |
$options = [] | |
Map of known option names to information about them. | |
This file host two test case classes for the MediaWiki FormOptions class:
The split let us take advantage of setting up a fixture for the methods tests. Dummy class to makes FormOptions::$options public. Used by FormOptionsInitializationTest which need to verify the $options array is correctly set through the FormOptions::add() function.
Definition at line 16 of file FormOptionsInitializationTest.php.
FormOptionsExposed::getOptions | ( | ) |
Definition at line 17 of file FormOptionsInitializationTest.php.
References FormOptions\$options.