session: Add debug message for the used store class
[lhc/web/wiklou.git] / tests / phpunit / includes / session / SessionManagerTest.php
index cd0867d..3b4009e 100644 (file)
@@ -34,7 +34,9 @@ class SessionManagerTest extends MediaWikiTestCase {
                        ]
                ] );
                $this->logger = new \TestLogger( false, function ( $m ) {
-                       return substr( $m, 0, 15 ) === 'SessionBackend ' ? null : $m;
+                       return ( strpos( $m, 'SessionBackend ' ) === 0
+                               || strpos( $m, 'SessionManager using store ' ) === 0
+                       ) ? null : $m;
                } );
                $this->store = new TestBagOStuff();
 
@@ -259,14 +261,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 );