X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fsession%2FCookieSessionProviderTest.php;h=aeaf2737d5472ac4dc1de84beac9e7b385c5199c;hb=56d45558b102349f3480a46819669407aa3be2d6;hp=a47fd9a18b9a0e6a14644250634050adbef39cad;hpb=2d71bf187d5a56ed808a5ae3845d14e51008f195;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/session/CookieSessionProviderTest.php b/tests/phpunit/includes/session/CookieSessionProviderTest.php index a47fd9a18b..aeaf2737d5 100644 --- a/tests/phpunit/includes/session/CookieSessionProviderTest.php +++ b/tests/phpunit/includes/session/CookieSessionProviderTest.php @@ -157,7 +157,7 @@ class CookieSessionProviderTest extends MediaWikiTestCase { ); $msg = $provider->whyNoSession(); - $this->assertInstanceOf( 'Message', $msg ); + $this->assertInstanceOf( \Message::class, $msg ); $this->assertSame( 'sessionprovider-nocookies', $msg->getKey() ); } @@ -415,7 +415,7 @@ class CookieSessionProviderTest extends MediaWikiTestCase { ); TestingAccessWrapper::newFromObject( $backend )->usePhpSessionHandling = false; - $mock = $this->getMockBuilder( 'stdClass' ) + $mock = $this->getMockBuilder( stdClass::class ) ->setMethods( [ 'onUserSetCookies' ] ) ->getMock(); $mock->expects( $this->never() )->method( 'onUserSetCookies' ); @@ -519,7 +519,7 @@ class CookieSessionProviderTest extends MediaWikiTestCase { $normalExpiry = $config->get( 'CookieExpiration' ); $extendedExpiry = $config->get( 'ExtendedLoginCookieExpiration' ); - $extendedExpiry = (int)( $extendedExpiry === null ? 0 : $extendedExpiry ); + $extendedExpiry = (int)( $extendedExpiry ?? 0 ); $expect = [ 'MySessionName' => [ 'value' => (string)$sessionId, @@ -563,14 +563,14 @@ class CookieSessionProviderTest extends MediaWikiTestCase { } protected function getSentRequest() { - $sentResponse = $this->getMockBuilder( 'FauxResponse' ) + $sentResponse = $this->getMockBuilder( \FauxResponse::class ) ->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->getMockBuilder( 'FauxRequest' ) + $sentRequest = $this->getMockBuilder( \FauxRequest::class ) ->setMethods( [ 'response' ] )->getMock(); $sentRequest->expects( $this->any() )->method( 'response' ) ->will( $this->returnValue( $sentResponse ) ); @@ -608,7 +608,7 @@ class CookieSessionProviderTest extends MediaWikiTestCase { TestingAccessWrapper::newFromObject( $backend )->usePhpSessionHandling = false; // Anonymous user - $mock = $this->getMockBuilder( 'stdClass' ) + $mock = $this->getMockBuilder( stdClass::class ) ->setMethods( [ 'onUserSetCookies' ] )->getMock(); $mock->expects( $this->never() )->method( 'onUserSetCookies' ); $this->mergeMwGlobalArrayValue( 'wgHooks', [ 'UserSetCookies' => [ $mock ] ] );