);
$msg = $provider->whyNoSession();
- $this->assertInstanceOf( 'Message', $msg );
+ $this->assertInstanceOf( \Message::class, $msg );
$this->assertSame( 'sessionprovider-nocookies', $msg->getKey() );
}
);
TestingAccessWrapper::newFromObject( $backend )->usePhpSessionHandling = false;
- $mock = $this->getMockBuilder( 'stdClass' )
+ $mock = $this->getMockBuilder( stdClass::class )
->setMethods( [ 'onUserSetCookies' ] )
->getMock();
$mock->expects( $this->never() )->method( 'onUserSetCookies' );
$normalExpiry = $config->get( 'CookieExpiration' );
$extendedExpiry = $config->get( 'ExtendedLoginCookieExpiration' );
- $extendedExpiry = (int)( $extendedExpiry === null ? 0 : $extendedExpiry );
+ $extendedExpiry = (int)( $extendedExpiry ?? 0 );
$expect = [
'MySessionName' => [
'value' => (string)$sessionId,
}
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 ) );
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 ] ] );