X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fsession%2FSessionManagerTest.php;h=3b4009ee966964c709860cfdedbd7d0afabb2255;hb=17d8a57bde68073290f4b548ad28658181a11d0e;hp=b33cd24a340e4ea1b6972327df6e7588635652f9;hpb=6698b7ea1d63fbd2e3014bf563c3ad9e937bc8dd;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/session/SessionManagerTest.php b/tests/phpunit/includes/session/SessionManagerTest.php index b33cd24a34..3b4009ee96 100644 --- a/tests/phpunit/includes/session/SessionManagerTest.php +++ b/tests/phpunit/includes/session/SessionManagerTest.php @@ -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 ); @@ -711,10 +713,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() );