Merge "Documentation link changes"
[lhc/web/wiklou.git] / tests / phpunit / includes / session / SessionBackendTest.php
index 7459ed2..a3d5de7 100644 (file)
@@ -184,8 +184,8 @@ class SessionBackendTest extends MediaWikiTestCase {
                $request2 = new \FauxRequest();
                $session2 = $backend->getSession( $request2 );
 
-               $this->assertInstanceOf( 'MediaWiki\\Session\\Session', $session1 );
-               $this->assertInstanceOf( 'MediaWiki\\Session\\Session', $session2 );
+               $this->assertInstanceOf( Session::class, $session1 );
+               $this->assertInstanceOf( Session::class, $session2 );
                $this->assertSame( 2, count( $priv->requests ) );
 
                $index = \TestingAccessWrapper::newFromObject( $session1 )->index;
@@ -360,7 +360,7 @@ class SessionBackendTest extends MediaWikiTestCase {
        }
 
        public function testSetUser() {
-               $user = User::newFromName( 'UTSysop' );
+               $user = static::getTestSysop()->getUser();
 
                $this->provider = $this->getMock( 'DummySessionProvider', [ 'canChangeUser' ] );
                $this->provider->expects( $this->any() )->method( 'canChangeUser' )
@@ -484,7 +484,7 @@ class SessionBackendTest extends MediaWikiTestCase {
        }
 
        public function testSave() {
-               $user = User::newFromName( 'UTSysop' );
+               $user = static::getTestSysop()->getUser();
                $this->store = new TestBagOStuff();
                $testData = [ 'foo' => 'foo!', 'bar', [ 'baz', null ] ];
 
@@ -733,7 +733,7 @@ class SessionBackendTest extends MediaWikiTestCase {
        }
 
        public function testRenew() {
-               $user = User::newFromName( 'UTSysop' );
+               $user = static::getTestSysop()->getUser();
                $this->store = new TestBagOStuff();
                $testData = [ 'foo' => 'foo!', 'bar', [ 'baz', null ] ];
 
@@ -819,7 +819,7 @@ class SessionBackendTest extends MediaWikiTestCase {
                        PHPSessionHandler::install( SessionManager::singleton() );
                }
                if ( !PHPSessionHandler::isEnabled() ) {
-                       $rProp = new \ReflectionProperty( 'MediaWiki\\Session\\PHPSessionHandler', 'instance' );
+                       $rProp = new \ReflectionProperty( PHPSessionHandler::class, 'instance' );
                        $rProp->setAccessible( true );
                        $handler = \TestingAccessWrapper::newFromObject( $rProp->getValue() );
                        $resetHandler = new \ScopedCallback( function () use ( $handler ) {
@@ -829,7 +829,7 @@ class SessionBackendTest extends MediaWikiTestCase {
                        $handler->enable = true;
                }
 
-               $backend = $this->getBackend( User::newFromName( 'UTSysop' ) );
+               $backend = $this->getBackend( static::getTestSysop()->getUser() );
                \TestingAccessWrapper::newFromObject( $backend )->usePhpSessionHandling = true;
 
                $resetSingleton = TestUtils::setSessionManagerSingleton( $this->manager );
@@ -859,7 +859,7 @@ class SessionBackendTest extends MediaWikiTestCase {
                        PHPSessionHandler::install( SessionManager::singleton() );
                }
                if ( !PHPSessionHandler::isEnabled() ) {
-                       $rProp = new \ReflectionProperty( 'MediaWiki\\Session\\PHPSessionHandler', 'instance' );
+                       $rProp = new \ReflectionProperty( PHPSessionHandler::class, 'instance' );
                        $rProp->setAccessible( true );
                        $handler = \TestingAccessWrapper::newFromObject( $rProp->getValue() );
                        $resetHandler = new \ScopedCallback( function () use ( $handler ) {
@@ -895,7 +895,7 @@ class SessionBackendTest extends MediaWikiTestCase {
                        PHPSessionHandler::install( SessionManager::singleton() );
                }
                if ( !PHPSessionHandler::isEnabled() ) {
-                       $rProp = new \ReflectionProperty( 'MediaWiki\\Session\\PHPSessionHandler', 'instance' );
+                       $rProp = new \ReflectionProperty( PHPSessionHandler::class, 'instance' );
                        $rProp->setAccessible( true );
                        $handler = \TestingAccessWrapper::newFromObject( $rProp->getValue() );
                        $resetHandler = new \ScopedCallback( function () use ( $handler ) {