Merge "StringUtils: Add a utility for checking if a string is a valid regex"
[lhc/web/wiklou.git] / tests / phpunit / includes / session / SessionManagerTest.php
index e042f76..b2f525d 100644 (file)
@@ -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() );
@@ -258,14 +259,14 @@ class SessionManagerTest extends MediaWikiTestCase {
                try {
                        $manager->getSessionForRequest( $request );
                        $this->fail( 'Expcected exception not thrown' );
-               } catch ( \OverflowException $ex ) {
+               } catch ( SessionOverflowException $ex ) {
                        $this->assertStringStartsWith(
                                'Multiple sessions for this request tied for top priority: ',
                                $ex->getMessage()
                        );
-                       $this->assertCount( 2, $ex->sessionInfos );
-                       $this->assertContains( $request->info1, $ex->sessionInfos );
-                       $this->assertContains( $request->info2, $ex->sessionInfos );
+                       $this->assertCount( 2, $ex->getSessionInfos() );
+                       $this->assertContains( $request->info1, $ex->getSessionInfos() );
+                       $this->assertContains( $request->info2, $ex->getSessionInfos() );
                }
                $this->assertFalse( $request->unpersist1 );
                $this->assertFalse( $request->unpersist2 );
@@ -710,10 +711,10 @@ class SessionManagerTest extends MediaWikiTestCase {
                ] );
 
                $expect = [
-                       'Foo' => [],
-                       'Bar' => [ 'X', 'Bar1', 3 => 'Bar2' ],
-                       'Quux' => [ 'Quux' ],
-                       'Baz' => [],
+                       'Foo' => null,
+                       'Bar' => null,
+                       'Quux' => null,
+                       'Baz' => null,
                ];
 
                $this->assertEquals( $expect, $manager->getVaryHeaders() );