23 'wgRCWatchCategoryMembership' =>
true,
24 'wgUseRCPatrol' =>
true,
35 # setup the ChangesListSpecialPage (or subclass) object
36 $this->changesListSpecialPage = $this->
getPage();
37 $context = $this->changesListSpecialPage->getContext();
40 $this->changesListSpecialPage->setContext(
$context );
41 $this->changesListSpecialPage->registerFilters();
51 if ( $this->oldPatrollersGroup !==
null ) {
63 foreach ( $expected as $key =>
$value ) {
72 $this->changesListSpecialPage->parseParameters(
79 $opts->getAllValues(),
91 $expectedRedirectOptions,
96 $output = $this->getMockBuilder( OutputPage::class )
97 ->disableProxyingToOriginalMethods()
98 ->disableOriginalConstructor()
100 $output->method(
'redirect' )->willReturnCallback(
101 function ( $url ) use ( &$redirectQuery, &$redirected ) {
103 $query = $urlParts[
'query' ] ??
'';
104 parse_str(
$query, $redirectQuery );
112 $user->setOption(
'rcenhancedfilters-disable', $rcfilters ? 0 : 1 );
113 $ctx->setUser( $user );
118 'ChangesListSpecialPageStructuredFilters',
125 $opts = $clsp->getDefaultOptions();
127 foreach ( $optionsToSet as $option =>
$value ) {
128 $opts->setValue( $option,
$value );
131 $clsp->validateOptions( $opts );
133 $this->assertEquals( $expectedRedirect, $redirected,
'redirection' );
135 if ( $expectedRedirect ) {
136 if ( count( $expectedRedirectOptions ) > 0 ) {
137 $expectedRedirectOptions += [
138 'title' => $clsp->getPageTitle()->getPrefixedText(),
143 $expectedRedirectOptions,
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
$wgGroupPermissions['sysop']['replacetext']
Abstract base class for shared logic when testing ChangesListSpecialPage and subclasses.
testParseParameters( $params, $expected)
provideParseParameters
testValidateOptions( $optionsToSet, $expectedRedirect, $expectedRedirectOptions, $rcfilters)
validateOptionsProvider
ChangesListSpecialPage $changesListSpecialPage
Special page which uses a ChangesList to show query results.
An IContextSource implementation which will inherit context from another source but allow individual ...
Group all the pieces relevant to the context of a request into one instance.
setContext( $context)
Sets the context this SpecialPage is executed in.
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
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place $output