From: Brad Jorsch Date: Tue, 16 Oct 2018 14:22:33 +0000 (-0400) Subject: Add session_write_close() calls to SessionManager tests X-Git-Tag: 1.31.2~82 X-Git-Url: http://git.cyclocoop.org/data/%27%20.%20mediabox_timestamp%28find_in_path%28%27javascript/%7B%24www_url%7Dadmin/compta/operations/%40%20%27info_etape_suivante_2%27%20=%3E%20%27You%20can%20move%20on%20to%20the%20next%20step.%27%2C%20%27info_exceptions_proxy%27%20=%3E%20%27Exceptions%20for%20the%20proxy%27%2C%20%27info_exportation_base%27%20=%3E%20%27export%20database%20to%20%40archive%40%27%2C-%27info_facilite_suivi_activite%27%20=%3E%20%27To%20simplify%20monitoring%20of%20the%20site/%27s%20editorial;-%20%20activities%2C%20SPIP%20can%20send%20rmail%20notifications%2C%20e.g.%20to%20an%20editors/%27.%28%24current%20%3E%202?a=commitdiff_plain;h=c1c0d243522d477799bb5ca325a100fa6a86a7fd;p=lhc%2Fweb%2Fwiklou.git Add session_write_close() calls to SessionManager tests PHP 7.3 doesn't like it if session_id() is called when the session has been started, so we need to be sure to close it first in a few tests. Bug: T207112 Change-Id: Ief36c1bb7b5c9066f158b5bb0d6d785a7f7ddd3c (cherry picked from commit 6698b7ea1d63fbd2e3014bf563c3ad9e937bc8dd) --- diff --git a/tests/phpunit/includes/session/SessionBackendTest.php b/tests/phpunit/includes/session/SessionBackendTest.php index ae19278cb6..48c3d179e7 100644 --- a/tests/phpunit/includes/session/SessionBackendTest.php +++ b/tests/phpunit/includes/session/SessionBackendTest.php @@ -941,6 +941,7 @@ class SessionBackendTest extends MediaWikiTestCase { \Wikimedia\quietCall( 'session_start' ); $backend->unpersist(); $this->assertSame( self::SESSIONID . 'x', session_id() ); + session_write_close(); session_id( self::SESSIONID ); $wrap->persist = true; diff --git a/tests/phpunit/includes/session/SessionManagerTest.php b/tests/phpunit/includes/session/SessionManagerTest.php index e042f7655a..b33cd24a34 100644 --- a/tests/phpunit/includes/session/SessionManagerTest.php +++ b/tests/phpunit/includes/session/SessionManagerTest.php @@ -82,6 +82,7 @@ class SessionManagerTest extends MediaWikiTestCase { $context->setRequest( $request ); $id = $request->getSession()->getId(); + session_write_close(); session_id( '' ); $session = SessionManager::getGlobalSession(); $this->assertSame( $id, $session->getId() );