diff options
author | Brad Jorsch <bjorsch@wikimedia.org> | 2016-01-29 18:02:11 -0500 |
---|---|---|
committer | BryanDavis <bdavis@wikimedia.org> | 2016-01-30 00:26:03 +0000 |
commit | fcdd643a46d87b677f6cdcc3ba9440e1472d8df7 (patch) | |
tree | 4e81f677b09ca24c96f0a21c4d7842da05cd6341 /tests/phpunit/includes/session/SessionBackendTest.php | |
parent | 982869d6b0c145d7b53aad255efaf0702c434e1f (diff) | |
download | mediawikicore-fcdd643a46d87b677f6cdcc3ba9440e1472d8df7.tar.gz mediawikicore-fcdd643a46d87b677f6cdcc3ba9440e1472d8df7.zip |
SessionManager: Don't save non-persisted sessions to backend storage
This introduces an in-process cache (using a HashBagOStuff) for session
data, and only saves to the external cache when the session is
persisted.
Bug: T125267
Change-Id: Ie161e0f7522cd68515b060ad8cf8c151b7198b0b
Diffstat (limited to 'tests/phpunit/includes/session/SessionBackendTest.php')
-rw-r--r-- | tests/phpunit/includes/session/SessionBackendTest.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/phpunit/includes/session/SessionBackendTest.php b/tests/phpunit/includes/session/SessionBackendTest.php index d06706bf637e..85fa9bdca0b0 100644 --- a/tests/phpunit/includes/session/SessionBackendTest.php +++ b/tests/phpunit/includes/session/SessionBackendTest.php @@ -59,7 +59,7 @@ class SessionBackendTest extends MediaWikiTestCase { ) ); $id = new SessionId( $info->getId() ); - $backend = new SessionBackend( $id, $info, $this->store, $logger, 10 ); + $backend = new SessionBackend( $id, $info, $this->store, $this->store, $logger, 10 ); $priv = \TestingAccessWrapper::newFromObject( $backend ); $priv->persist = false; $priv->requests = array( 100 => new \FauxRequest() ); @@ -87,7 +87,7 @@ class SessionBackendTest extends MediaWikiTestCase { $id = new SessionId( $info->getId() ); $logger = new \Psr\Log\NullLogger(); try { - new SessionBackend( $id, $info, $this->store, $logger, 10 ); + new SessionBackend( $id, $info, $this->store, $this->store, $logger, 10 ); $this->fail( 'Expected exception not thrown' ); } catch ( \InvalidArgumentException $ex ) { $this->assertSame( @@ -103,7 +103,7 @@ class SessionBackendTest extends MediaWikiTestCase { ) ); $id = new SessionId( $info->getId() ); try { - new SessionBackend( $id, $info, $this->store, $logger, 10 ); + new SessionBackend( $id, $info, $this->store, $this->store, $logger, 10 ); $this->fail( 'Expected exception not thrown' ); } catch ( \InvalidArgumentException $ex ) { $this->assertSame( 'Cannot create session without a provider', $ex->getMessage() ); @@ -118,7 +118,7 @@ class SessionBackendTest extends MediaWikiTestCase { ) ); $id = new SessionId( '!' . $info->getId() ); try { - new SessionBackend( $id, $info, $this->store, $logger, 10 ); + new SessionBackend( $id, $info, $this->store, $this->store, $logger, 10 ); $this->fail( 'Expected exception not thrown' ); } catch ( \InvalidArgumentException $ex ) { $this->assertSame( @@ -135,7 +135,7 @@ class SessionBackendTest extends MediaWikiTestCase { 'idIsSafe' => true, ) ); $id = new SessionId( $info->getId() ); - $backend = new SessionBackend( $id, $info, $this->store, $logger, 10 ); + $backend = new SessionBackend( $id, $info, $this->store, $this->store, $logger, 10 ); $this->assertSame( self::SESSIONID, $backend->getId() ); $this->assertSame( $id, $backend->getSessionId() ); $this->assertSame( $this->provider, $backend->getProvider() ); @@ -157,7 +157,7 @@ class SessionBackendTest extends MediaWikiTestCase { 'idIsSafe' => true, ) ); $id = new SessionId( $info->getId() ); - $backend = new SessionBackend( $id, $info, $this->store, $logger, 10 ); + $backend = new SessionBackend( $id, $info, $this->store, $this->store, $logger, 10 ); $this->assertSame( self::SESSIONID, $backend->getId() ); $this->assertSame( $id, $backend->getSessionId() ); $this->assertSame( $this->provider, $backend->getProvider() ); |