Go to the documentation of this file.
3 use Wikimedia\TestingAccessWrapper;
17 'ChangesListSpecialPageQuery',
22 'wgDefaultUserOptions',
24 'extendwatchlist' => 1,
25 'watchlistdays' => 3.0,
26 'watchlisthideanons' => 0,
27 'watchlisthidebots' => 0,
28 'watchlisthideliu' => 0,
29 'watchlisthideminor' => 0,
30 'watchlisthideown' => 0,
31 'watchlisthidepatrolled' => 0,
32 'watchlisthidecategorization' => 1,
33 'watchlistreloadautomatically' => 0,
34 'watchlistunwatchlinks' => 0,
56 $this->assertContains(
'(nowatchlist)',
$html );
63 $expectedValuesDefaults, $expectedValues, $preferences, $inputParams
68 $page = TestingAccessWrapper::newFromObject(
72 $page->registerFilters();
75 $wikiDefaults = $page->getDefaultOptions()->getAllValues();
77 switch ( $expectedValuesDefaults ) {
79 $allFalse = $wikiDefaults;
81 foreach ( $allFalse
as $key =>
$value ) {
83 $allFalse[$key] =
false;
89 $allFalse[
'extended'] =
true;
91 $expectedValues += $allFalse;
94 $expectedValues += $wikiDefaults;
97 $this->fail(
"Unknown \$expectedValuesDefaults: $expectedValuesDefaults" );
100 $page = TestingAccessWrapper::newFromObject(
106 $fauxRequest =
new FauxRequest( $inputParams,
false );
109 foreach ( $preferences
as $key =>
$value ) {
113 $context->setRequest( $fauxRequest );
117 $page->registerFilters();
118 $formOptions = $page->getDefaultOptions();
119 $page->fetchOptionsFromRequest( $formOptions );
123 $formOptions->getAllValues(),
131 'ignores casing' => [
132 'expectedValuesDefaults' =>
'wikiDefaults',
133 'expectedValues' => [
142 'first two same as prefs, second two overriden' => [
143 'expectedValuesDefaults' =>
'wikiDefaults',
144 'expectedValues' => [
150 'hideanons' =>
false,
152 'userExpLevel' =>
'registered'
155 'watchlisthideminor' => 1,
156 'watchlisthidebots' => 0,
158 'watchlisthideanons' => 1,
159 'watchlisthideliu' => 0,
167 'Defaults/preferences for form elements are entirely ignored for '
168 .
'action=submit and omitted elements become false' => [
169 'expectedValuesDefaults' =>
'allFalse',
170 'expectedValues' => [
171 'hideminor' =>
false,
173 'hideanons' =>
false,
175 'userExpLevel' =>
'unregistered'
178 'watchlisthideminor' => 0,
179 'watchlisthidebots' => 1,
181 'watchlisthideanons' => 0,
182 'watchlisthideliu' => 1,
187 'action' =>
'submit',
return true to allow those checks to and false if checking is done & $user
WebRequest clone which takes values from a provided array.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
testNotLoggedIn_throwsException()
testFetchOptionsFromRequest( $expectedValuesDefaults, $expectedValues, $preferences, $inputParams)
provideFetchOptionsFromRequest
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Wraps the user object, so we can also retain full access to properties like password if we log in via...
An IContextSource implementation which will inherit context from another source but allow individual ...
Base class for testing special pages.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
provideFetchOptionsFromRequest()
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
A special page that lists last changes made to the wiki, limited to user-defined list of titles.
executeSpecialPage( $subPage='', WebRequest $request=null, $language=null, User $user=null)
testUserWithNoWatchedItems_displaysNoWatchlistMessage()
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
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
newSpecialPage()
Returns a new instance of the special page under test.