"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/phpunit/includes/specialpage/AbstractChangesListSpecialPageTestCase.php" between
mediawiki-1.31.1.tar.gz and mediawiki-1.32.0.tar.gz

About: MediaWiki is a wiki engine (the collaborative editing software that runs for e.g. Wikipedia, the free encyclopedia).

AbstractChangesListSpecialPageTestCase.php  (mediawiki-1.31.1):AbstractChangesListSpecialPageTestCase.php  (mediawiki-1.32.0)
skipping to change at line 35 skipping to change at line 35
] ); ] );
if ( isset( $wgGroupPermissions['patrollers'] ) ) { if ( isset( $wgGroupPermissions['patrollers'] ) ) {
$this->oldPatrollersGroup = $wgGroupPermissions['patrolle rs']; $this->oldPatrollersGroup = $wgGroupPermissions['patrolle rs'];
} }
$wgGroupPermissions['patrollers'] = [ $wgGroupPermissions['patrollers'] = [
'patrol' => true, 'patrol' => true,
]; ];
// Deprecated
$this->setTemporaryHook(
'ChangesListSpecialPageFilters',
null
);
# setup the ChangesListSpecialPage (or subclass) object # setup the ChangesListSpecialPage (or subclass) object
$this->changesListSpecialPage = $this->getPage(); $this->changesListSpecialPage = $this->getPage();
$context = $this->changesListSpecialPage->getContext(); $context = $this->changesListSpecialPage->getContext();
$context = new DerivativeContext( $context ); $context = new DerivativeContext( $context );
$context->setUser( $this->getTestUser( [ 'patrollers' ] )->getUse r() ); $context->setUser( $this->getTestUser( [ 'patrollers' ] )->getUse r() );
$this->changesListSpecialPage->setContext( $context ); $this->changesListSpecialPage->setContext( $context );
$this->changesListSpecialPage->registerFilters(); $this->changesListSpecialPage->registerFilters();
} }
abstract protected function getPage(); abstract protected function getPage();
skipping to change at line 94 skipping to change at line 88
$expected, $expected,
$opts->getAllValues(), $opts->getAllValues(),
/** ordered= */ false, /** ordered= */ false,
/** named= */ true /** named= */ true
); );
} }
/** /**
* @dataProvider validateOptionsProvider * @dataProvider validateOptionsProvider
*/ */
public function testValidateOptions( $optionsToSet, $expectedRedirect, $e public function testValidateOptions(
xpectedRedirectOptions ) { $optionsToSet,
$expectedRedirect,
$expectedRedirectOptions,
$rcfilters
) {
$redirectQuery = []; $redirectQuery = [];
$redirected = false; $redirected = false;
$output = $this->getMockBuilder( OutputPage::class ) $output = $this->getMockBuilder( OutputPage::class )
->disableProxyingToOriginalMethods() ->disableProxyingToOriginalMethods()
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$output->method( 'redirect' )->willReturnCallback( $output->method( 'redirect' )->willReturnCallback(
function ( $url ) use ( &$redirectQuery, &$redirected ) { function ( $url ) use ( &$redirectQuery, &$redirected ) {
$urlParts = wfParseUrl( $url ); $urlParts = wfParseUrl( $url );
$query = isset( $urlParts[ 'query' ] ) ? $urlPart s[ 'query' ] : ''; $query = $urlParts[ 'query' ] ?? '';
parse_str( $query, $redirectQuery ); parse_str( $query, $redirectQuery );
$redirected = true; $redirected = true;
} }
); );
$ctx = new RequestContext(); $ctx = new RequestContext();
// Give users patrol permissions so we can test that. // Give users patrol permissions so we can test that.
$user = $this->getTestSysop()->getUser(); $user = $this->getTestSysop()->getUser();
$user->setOption( 'rcenhancedfilters-disable', $rcfilters ? 0 : 1 );
$ctx->setUser( $user ); $ctx->setUser( $user );
// Disable this hook or it could break changeType // Disable this hook or it could break changeType
// depending on which other extensions are running. // depending on which other extensions are running.
$this->setTemporaryHook( $this->setTemporaryHook(
'ChangesListSpecialPageStructuredFilters', 'ChangesListSpecialPageStructuredFilters',
null null
); );
$ctx->setOutput( $output ); $ctx->setOutput( $output );
 End of changes. 4 change blocks. 
9 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)