22 $this->
setMwGlobals(
'wgRCWatchCategoryMembership',
true );
34 'ChangesListSpecialPageFilters',
38 # setup the ChangesListSpecialPage (or subclass) object
39 $this->changesListSpecialPage = $this->getPage();
40 $context = $this->changesListSpecialPage->getContext();
43 $this->changesListSpecialPage->setContext(
$context );
44 $this->changesListSpecialPage->registerFilters();
52 if ( $this->oldPatrollersGroup !==
null ) {
62 foreach ( $expected as $key =>
$value ) {
71 $this->changesListSpecialPage->parseParameters(
78 $opts->getAllValues(),
90 $output = $this->getMockBuilder( OutputPage::class )
91 ->disableProxyingToOriginalMethods()
92 ->disableOriginalConstructor()
94 $output->method(
'redirect' )->willReturnCallback(
95 function ( $url ) use ( &$redirectQuery, &$redirected ) {
97 $query = isset( $urlParts[
'query' ] ) ? $urlParts[
'query' ] :
'';
98 parse_str(
$query, $redirectQuery );
106 $ctx->setUser( $user );
111 'ChangesListSpecialPageStructuredFilters',
118 $opts = $clsp->getDefaultOptions();
120 foreach ( $optionsToSet as $option =>
$value ) {
121 $opts->setValue( $option,
$value );
124 $clsp->validateOptions( $opts );
126 $this->assertEquals( $expectedRedirect, $redirected,
'redirection' );
128 if ( $expectedRedirect ) {
129 if ( count( $expectedRedirectOptions ) > 0 ) {
130 $expectedRedirectOptions += [
131 'title' => $clsp->getPageTitle()->getPrefixedText(),
136 $expectedRedirectOptions,
$wgGroupPermissions
Permission keys given to users in each group.
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
Abstract base class for shared logic when testing ChangesListSpecialPage and subclasses.
testParseParameters( $params, $expected)
provideParseParameters
testValidateOptions( $optionsToSet, $expectedRedirect, $expectedRedirectOptions)
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.
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title after the basic globals have been set but before ordinary actions take place $output
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