Merge "RC Filters: correctly read default value for 'string_options' filters"
[lhc/web/wiklou.git] / tests / phpunit / includes / session / ImmutableSessionProviderWithCookieTest.php
index 2412a3b..7ef230e 100644 (file)
@@ -24,7 +24,7 @@ class ImmutableSessionProviderWithCookieTest extends MediaWikiTestCase {
                        $params['sessionCookieOptions']['prefix'] = $prefix;
                }
 
-               $provider = $this->getMockBuilder( 'MediaWiki\\Session\\ImmutableSessionProviderWithCookie' )
+               $provider = $this->getMockBuilder( ImmutableSessionProviderWithCookie::class )
                        ->setConstructorArgs( [ $params ] )
                        ->getMockForAbstractClass();
                $provider->setLogger( new \TestLogger() );
@@ -35,13 +35,13 @@ class ImmutableSessionProviderWithCookieTest extends MediaWikiTestCase {
        }
 
        public function testConstructor() {
-               $provider = $this->getMockBuilder( 'MediaWiki\\Session\\ImmutableSessionProviderWithCookie' )
+               $provider = $this->getMockBuilder( ImmutableSessionProviderWithCookie::class )
                        ->getMockForAbstractClass();
                $priv = \TestingAccessWrapper::newFromObject( $provider );
                $this->assertNull( $priv->sessionCookieName );
                $this->assertSame( [], $priv->sessionCookieOptions );
 
-               $provider = $this->getMockBuilder( 'MediaWiki\\Session\\ImmutableSessionProviderWithCookie' )
+               $provider = $this->getMockBuilder( ImmutableSessionProviderWithCookie::class )
                        ->setConstructorArgs( [ [
                                'sessionCookieName' => 'Foo',
                                'sessionCookieOptions' => [ 'Bar' ],
@@ -52,7 +52,7 @@ class ImmutableSessionProviderWithCookieTest extends MediaWikiTestCase {
                $this->assertSame( [ 'Bar' ], $priv->sessionCookieOptions );
 
                try {
-                       $provider = $this->getMockBuilder( 'MediaWiki\\Session\\ImmutableSessionProviderWithCookie' )
+                       $provider = $this->getMockBuilder( ImmutableSessionProviderWithCookie::class )
                                ->setConstructorArgs( [ [
                                        'sessionCookieName' => false,
                                ] ] )
@@ -66,7 +66,7 @@ class ImmutableSessionProviderWithCookieTest extends MediaWikiTestCase {
                }
 
                try {
-                       $provider = $this->getMockBuilder( 'MediaWiki\\Session\\ImmutableSessionProviderWithCookie' )
+                       $provider = $this->getMockBuilder( ImmutableSessionProviderWithCookie::class )
                                ->setConstructorArgs( [ [
                                        'sessionCookieOptions' => 'x',
                                ] ] )
@@ -157,13 +157,16 @@ class ImmutableSessionProviderWithCookieTest extends MediaWikiTestCase {
        }
 
        protected function getSentRequest() {
-               $sentResponse = $this->getMock( 'FauxResponse', [ 'headersSent', 'setCookie', 'header' ] );
+               $sentResponse = $this->getMockBuilder( 'FauxResponse' )
+                       ->setMethods( [ 'headersSent', 'setCookie', 'header' ] )
+                       ->getMock();
                $sentResponse->expects( $this->any() )->method( 'headersSent' )
                        ->will( $this->returnValue( true ) );
                $sentResponse->expects( $this->never() )->method( 'setCookie' );
                $sentResponse->expects( $this->never() )->method( 'header' );
 
-               $sentRequest = $this->getMock( 'FauxRequest', [ 'response' ] );
+               $sentRequest = $this->getMockBuilder( 'FauxRequest' )
+                       ->setMethods( [ 'response' ] )->getMock();
                $sentRequest->expects( $this->any() )->method( 'response' )
                        ->will( $this->returnValue( $sentResponse ) );
                return $sentRequest;
@@ -249,7 +252,7 @@ class ImmutableSessionProviderWithCookieTest extends MediaWikiTestCase {
                        }
                        $this->assertEquals( [
                                'value' => 'true',
-                               'expire' => $remember ? 100 : null,
+                               'expire' => null,
                                'path' => 'CookiePath',
                                'domain' => 'CookieDomain',
                                'secure' => false,