MediaWiki REL1_27
|
tests for includes/Html.php More...
Static Public Member Functions | |
static | provideElementsWithAttributesHavingDefaultValues () |
static | provideHtml5InputTypes () |
List of input element types values introduced by HTML5 Full list at http://www.w3.org/TR/html-markup/input.html. | |
static | provideSrcSetImages () |
Static Public Member Functions inherited from MediaWikiTestCase | |
static | assertNotTag ( $matcher, $actual, $message='', $isHtml=true) |
static | assertTag ( $matcher, $actual, $message='', $isHtml=true) |
Note: we are overriding this method to remove the deprecated error. | |
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. | |
static | teardownTestDB () |
Restores MediaWiki to using the table set (table prefix) it was using before setupTestDB() was called. | |
static | wfResetOutputBuffersBarrier ( $buffer) |
Used as a marker to prevent wfResetOutputBuffers from breaking PHPUnit. | |
Protected Member Functions | |
setUp () | |
Protected Member Functions inherited from MediaWikiTestCase | |
addTmpFiles ( $files) | |
arrayWrap (array $elements) | |
Utility method taking an array of elements and wrapping each element in its own array. | |
assertArrayEquals (array $expected, array $actual, $ordered=false, $named=false) | |
Assert that two arrays are equal. | |
assertHTMLEquals ( $expected, $actual, $msg='') | |
Put each HTML element on its own line and then equals() the results. | |
assertSelect ( $table, $fields, $condition, array $expectedRows) | |
Asserts that the given database query yields the rows given by $expectedRows. | |
assertType ( $type, $actual, $message='') | |
Asserts the type of the provided value. | |
assertTypeOrValue ( $type, $actual, $value=false, $message='') | |
Asserts that the provided variable is of the specified internal type or equals the $value argument. | |
assertValidHtmlDocument ( $html) | |
Asserts that the given string is valid HTML document. | |
assertValidHtmlSnippet ( $html) | |
Asserts that the given string is a valid HTML snippet. | |
checkDbIsSupported () | |
checkHasGzip () | |
Check whether we have the 'gzip' commandline utility, will skip the test whenever "gzip -V" fails. | |
checkPHPExtension ( $extName) | |
Check if $extName is a loaded PHP extension, will skip the test whenever it is not loaded. | |
getDefaultWikitextNS () | |
Returns the ID of a namespace that defaults to Wikitext. | |
getNewTempDirectory () | |
obtains a new temporary directory | |
getNewTempFile () | |
Obtains a new temporary file name. | |
insertPage ( $pageName, $text='Sample page for unit test.') | |
Insert a new page. | |
isWikitextNS ( $ns) | |
Returns true if the given namespace defaults to Wikitext according to $wgNamespaceContentModels. | |
markTestSkippedIfNoDiff3 () | |
Check, if $wgDiff3 is set and ready to merge Will mark the calling test as skipped, if not ready. | |
mergeMwGlobalArrayValue ( $name, $values) | |
Merges the given values into a MW global array variable. | |
objectAssociativeSort (array &$array) | |
Does an associative sort that works for objects. | |
setLogger ( $channel, LoggerInterface $logger) | |
Sets the logger for a specified channel, for the duration of the test. | |
setMwGlobals ( $pairs, $value=null) | |
stashMwGlobals ( $globalKeys) | |
Stashes the global, will be restored in tearDown() | |
tearDown () | |
Additional Inherited Members | |
Public Attributes inherited from MediaWikiTestCase | |
const | DB_PREFIX = 'unittest_' |
Table name prefixes. | |
const | ORA_DB_PREFIX = 'ut_' |
Static Public Attributes inherited from MediaWikiTestCase | |
static TestUser[] | $users |
Static Protected Member Functions inherited from MediaWikiTestCase | |
static | getExternalStoreDatabaseConnections () |
Gets master database connections for all of the ExternalStoreDB stores configured in $wgDefaultExternalStore. | |
static | isUsingExternalStoreDB () |
Check whether ExternalStoreDB is being used. | |
static | setupDatabaseWithTestPrefix (DatabaseBase $db, $prefix) |
Setups a database with the given prefix. | |
static | setupExternalStoreTestDBs ( $testPrefix) |
Clones the External Store database(s) for testing. | |
static | stripStringKeys (&$r) |
Utility function for eliminating all string keys from an array. | |
Protected Attributes inherited from MediaWikiTestCase | |
DatabaseBase | $db |
Primary database. | |
array | $supportedDBs |
array | $tablesUsed = [] |
tests for includes/Html.php
Definition at line 4 of file HtmlTest.php.
HtmlTest::dataXmlMimeType | ( | ) |
Definition at line 71 of file HtmlTest.php.
|
static |
|
static |
List of input element types values introduced by HTML5 Full list at http://www.w3.org/TR/html-markup/input.html.
Definition at line 464 of file HtmlTest.php.
|
static |
Definition at line 740 of file HtmlTest.php.
|
protected |
Reimplemented from MediaWikiTestCase.
Definition at line 6 of file HtmlTest.php.
References MediaWikiTestCase\setContentLang(), MediaWikiTestCase\setMwGlobals(), and MediaWikiTestCase\setUserLang().
HtmlTest::testCanDisableANamespaces | ( | ) |
Definition at line 421 of file HtmlTest.php.
References Html\namespaceSelector().
HtmlTest::testCanFilterOutNamespaces | ( | ) |
Definition at line 399 of file HtmlTest.php.
References Html\namespaceSelector().
HtmlTest::testDropDefaults | ( | $expected, | |
$element, | |||
$attribs, | |||
$message = '' |
|||
) |
Test out Html::element drops or enforces default value Html::dropDefaults provideElementsWithAttributesHavingDefaultValues.
Definition at line 493 of file HtmlTest.php.
References $attribs, and Html\element().
HtmlTest::testElementBasics | ( | ) |
HtmlTest::testExpandAttributes_ArrayOnNonListValueAttribute_ThrowsException | ( | ) |
Html::expandAttributes MWException.
Definition at line 306 of file HtmlTest.php.
References Html\expandAttributes().
HtmlTest::testExpandAttributesForBooleans | ( | ) |
Definition at line 121 of file HtmlTest.php.
References Html\expandAttributes().
HtmlTest::testExpandAttributesForNumbers | ( | ) |
Definition at line 154 of file HtmlTest.php.
References Html\expandAttributes().
HtmlTest::testExpandAttributesForObjects | ( | ) |
Definition at line 170 of file HtmlTest.php.
References Html\expandAttributes().
HtmlTest::testExpandAttributesListValueAttributes | ( | ) |
Html::expandAttributes has special features for HTML attributes that use space separated lists and also allows arrays to be used as values.
Definition at line 214 of file HtmlTest.php.
References Html\expandAttributes().
HtmlTest::testExpandAttributesSkipsNullAndFalse | ( | ) |
Definition at line 100 of file HtmlTest.php.
References Html\expandAttributes().
HtmlTest::testExpandAttributesSpaceSeparatedAttributesWithBoolean | ( | ) |
Test feature added by r96188, let pass attributes values as a PHP array.
Restricted to class,rel, accesskey. Html::expandAttributes
Definition at line 266 of file HtmlTest.php.
References attributes, Html\expandAttributes(), use, values, and well.
HtmlTest::testExpandAttributesVariousExpansions | ( | ) |
Test for Html::expandAttributes() Please note it output a string prefixed with a space! Html::expandAttributes.
Definition at line 183 of file HtmlTest.php.
References Html\expandAttributes().
HtmlTest::testFormValidationBlacklist | ( | ) |
Definition at line 657 of file HtmlTest.php.
References Html\expandAttributes().
HtmlTest::testHtmlElementAcceptsNewHtml5TypesInHtml5Mode | ( | $HTML5InputType | ) |
provideHtml5InputTypes Html::element
Definition at line 452 of file HtmlTest.php.
References Html\element().
HtmlTest::testNamespaceSelector | ( | ) |
Definition at line 320 of file HtmlTest.php.
References Html\namespaceSelector().
HtmlTest::testSrcSet | ( | $images, | |
$expected, | |||
$message | |||
) |
provideSrcSetImages Html::srcSet
Definition at line 760 of file HtmlTest.php.
References Html\srcSet().
HtmlTest::testValueIsAuthoritativeInSpaceSeparatedAttributesArrays | ( | ) |
How do we handle duplicate keys in HTML attributes expansion? We could pass a "class" the values: 'GREEN' and array( 'GREEN' => false ) The later will take precedence.
Feature added by r96188 Html::expandAttributes
Definition at line 291 of file HtmlTest.php.
References Html\expandAttributes().
HtmlTest::testWrapperCheck | ( | ) |
Definition at line 696 of file HtmlTest.php.
References Html\check().
HtmlTest::testWrapperInput | ( | ) |
Definition at line 683 of file HtmlTest.php.
References Html\input().
HtmlTest::testWrapperLabel | ( | ) |
Definition at line 732 of file HtmlTest.php.
References Html\label().
HtmlTest::testWrapperRadio | ( | ) |
Definition at line 714 of file HtmlTest.php.
References Html\radio().
HtmlTest::testXmlMimeType | ( | $mimetype, | |
$isXmlMimeType | |||
) |
dataXmlMimeType Html::isXmlMimeType
Definition at line 93 of file HtmlTest.php.
References Html\isXmlMimeType().