X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fsession%2FPHPSessionHandlerTest.php;h=fdaa336dbdbbfd3a5b3d88358ee23a9187742ffe;hb=17d8a57bde68073290f4b548ad28658181a11d0e;hp=b191a2fbf3f58148a968619ad891b4b1dfd6a464;hpb=dfd526b37e672de4702a94d3c617a38a4a39afad;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/session/PHPSessionHandlerTest.php b/tests/phpunit/includes/session/PHPSessionHandlerTest.php index b191a2fbf3..fdaa336dbd 100644 --- a/tests/phpunit/includes/session/PHPSessionHandlerTest.php +++ b/tests/phpunit/includes/session/PHPSessionHandlerTest.php @@ -15,15 +15,6 @@ class PHPSessionHandlerTest extends MediaWikiTestCase { private function getResetter( &$rProp = null ) { $reset = []; - // Ignore "headers already sent" warnings during this test - set_error_handler( function ( $errno, $errstr ) use ( &$warnings ) { - if ( preg_match( '/[hH]eaders already sent/', $errstr ) ) { - return true; - } - return false; - } ); - $reset[] = new \Wikimedia\ScopedCallback( 'restore_error_handler' ); - $rProp = new \ReflectionProperty( PHPSessionHandler::class, 'instance' ); $rProp->setAccessible( true ); if ( $rProp->getValue() ) { @@ -80,7 +71,10 @@ class PHPSessionHandlerTest extends MediaWikiTestCase { ini_set( 'session.use_trans_sid', 1 ); $store = new TestBagOStuff(); - $logger = new \TestLogger(); + // Tolerate debug message, anything else is unexpected + $logger = new \TestLogger( false, function ( $m ) { + return preg_match( '/^SessionManager using store/', $m ) ? null : $m; + } ); $manager = new SessionManager( [ 'store' => $store, 'logger' => $logger, @@ -156,6 +150,7 @@ class PHPSessionHandlerTest extends MediaWikiTestCase { $expect = [ 'AuthenticationSessionTest' => $rand ]; session_write_close(); $this->assertSame( [ + [ LogLevel::DEBUG, 'SessionManager using store MediaWiki\Session\TestBagOStuff' ], [ LogLevel::WARNING, 'Something wrote to $_SESSION!' ], ], $logger->getBuffer() );