Merge "SessionProvider::mergeMetadata: Log additional data"
[lhc/web/wiklou.git] / tests / phpunit / includes / session / SessionBackendTest.php
index d06706b..f08a07d 100644 (file)
@@ -468,6 +468,8 @@ class SessionBackendTest extends MediaWikiTestCase {
                $this->assertInternalType( 'array', $metadata );
                $this->assertArrayHasKey( '???', $metadata );
                $this->assertSame( '!!!', $metadata['???'] );
+               $this->assertFalse( $this->store->getSessionFromBackend( self::SESSIONID ),
+                       'making sure it didn\'t save to backend' );
 
                // Persistent, not dirty
                $this->provider = $neverProvider;
@@ -516,6 +518,8 @@ class SessionBackendTest extends MediaWikiTestCase {
                $this->assertInternalType( 'array', $metadata );
                $this->assertArrayHasKey( '???', $metadata );
                $this->assertSame( '!!!', $metadata['???'] );
+               $this->assertNotSame( false, $this->store->getSessionFromBackend( self::SESSIONID ),
+                       'making sure it did save to backend' );
 
                $this->provider = $this->getMock( 'DummySessionProvider', array( 'persistSession' ) );
                $this->provider->expects( $this->atLeastOnce() )->method( 'persistSession' );
@@ -538,6 +542,8 @@ class SessionBackendTest extends MediaWikiTestCase {
                $this->assertInternalType( 'array', $metadata );
                $this->assertArrayHasKey( '???', $metadata );
                $this->assertSame( '!!!', $metadata['???'] );
+               $this->assertNotSame( false, $this->store->getSessionFromBackend( self::SESSIONID ),
+                       'making sure it did save to backend' );
 
                $this->provider = $this->getMock( 'DummySessionProvider', array( 'persistSession' ) );
                $this->provider->expects( $this->atLeastOnce() )->method( 'persistSession' );
@@ -559,6 +565,8 @@ class SessionBackendTest extends MediaWikiTestCase {
                $this->assertInternalType( 'array', $metadata );
                $this->assertArrayHasKey( '???', $metadata );
                $this->assertSame( '!!!', $metadata['???'] );
+               $this->assertNotSame( false, $this->store->getSessionFromBackend( self::SESSIONID ),
+                       'making sure it did save to backend' );
 
                // Not marked dirty, but dirty data
                $this->provider = $neverProvider;
@@ -581,6 +589,8 @@ class SessionBackendTest extends MediaWikiTestCase {
                $this->assertInternalType( 'array', $metadata );
                $this->assertArrayHasKey( '???', $metadata );
                $this->assertSame( '!!!', $metadata['???'] );
+               $this->assertNotSame( false, $this->store->getSessionFromBackend( self::SESSIONID ),
+                       'making sure it did save to backend' );
 
                // Bad hook
                $this->provider = null;