"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/phpunit/includes/session/PHPSessionHandlerTest.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).

PHPSessionHandlerTest.php  (mediawiki-1.31.1):PHPSessionHandlerTest.php  (mediawiki-1.32.0)
skipping to change at line 18 skipping to change at line 18
/** /**
* @group Session * @group Session
* @covers MediaWiki\Session\PHPSessionHandler * @covers MediaWiki\Session\PHPSessionHandler
*/ */
class PHPSessionHandlerTest extends MediaWikiTestCase { class PHPSessionHandlerTest extends MediaWikiTestCase {
private function getResetter( &$rProp = null ) { private function getResetter( &$rProp = null ) {
$reset = []; $reset = [];
// Ignore "headers already sent" warnings during this test
set_error_handler( function ( $errno, $errstr ) use ( &$warnings
) {
if ( preg_match( '/headers already sent/', $errstr ) ) {
return true;
}
return false;
} );
$reset[] = new \Wikimedia\ScopedCallback( 'restore_error_handler'
);
$rProp = new \ReflectionProperty( PHPSessionHandler::class, 'inst ance' ); $rProp = new \ReflectionProperty( PHPSessionHandler::class, 'inst ance' );
$rProp->setAccessible( true ); $rProp->setAccessible( true );
if ( $rProp->getValue() ) { if ( $rProp->getValue() ) {
$old = TestingAccessWrapper::newFromObject( $rProp->getVa lue() ); $old = TestingAccessWrapper::newFromObject( $rProp->getVa lue() );
$oldManager = $old->manager; $oldManager = $old->manager;
$oldStore = $old->store; $oldStore = $old->store;
$oldLogger = $old->logger; $oldLogger = $old->logger;
$reset[] = new \Wikimedia\ScopedCallback( $reset[] = new \Wikimedia\ScopedCallback(
[ PHPSessionHandler::class, 'install' ], [ PHPSessionHandler::class, 'install' ],
[ $oldManager, $oldStore, $oldLogger ] [ $oldManager, $oldStore, $oldLogger ]
skipping to change at line 129 skipping to change at line 120
return preg_match( '/^SessionBackend "\{session\}" /', $m ) ? null : $m; return preg_match( '/^SessionBackend "\{session\}" /', $m ) ? null : $m;
} ); } );
$manager = new SessionManager( [ $manager = new SessionManager( [
'store' => $store, 'store' => $store,
'logger' => $logger, 'logger' => $logger,
] ); ] );
PHPSessionHandler::install( $manager ); PHPSessionHandler::install( $manager );
$wrap = TestingAccessWrapper::newFromObject( $rProp->getValue() ) ; $wrap = TestingAccessWrapper::newFromObject( $rProp->getValue() ) ;
$reset[] = new \Wikimedia\ScopedCallback( $reset[] = new \Wikimedia\ScopedCallback(
[ $wrap, 'setEnableFlags' ], [ $wrap, 'setEnableFlags' ],
[ $wrap->enable ? $wrap->warn ? 'warn' : 'enable' : 'disa ble' ] [ $wrap->enable ? ( $wrap->warn ? 'warn' : 'enable' ) : ' disable' ]
); );
$wrap->setEnableFlags( 'warn' ); $wrap->setEnableFlags( 'warn' );
\Wikimedia\suppressWarnings(); \Wikimedia\suppressWarnings();
ini_set( 'session.serialize_handler', $handler ); ini_set( 'session.serialize_handler', $handler );
\Wikimedia\restoreWarnings(); \Wikimedia\restoreWarnings();
if ( ini_get( 'session.serialize_handler' ) !== $handler ) { if ( ini_get( 'session.serialize_handler' ) !== $handler ) {
$this->markTestSkipped( "Cannot set session.serialize_han dler to \"$handler\"" ); $this->markTestSkipped( "Cannot set session.serialize_han dler to \"$handler\"" );
} }
 End of changes. 2 change blocks. 
12 lines changed or deleted 1 lines changed or added

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