Merge "Add RemexHtml to the list of available Tidy drivers"
[lhc/web/wiklou.git] / tests / phpunit / includes / session / TestUtils.php
index 36175af..f00de55 100644 (file)
@@ -12,21 +12,21 @@ class TestUtils {
        /**
         * Override the singleton for unit testing
         * @param SessionManager|null $manager
-        * @return \\ScopedCallback|null
+        * @return \\Wikimedia\ScopedCallback|null
         */
        public static function setSessionManagerSingleton( SessionManager $manager = null ) {
                session_write_close();
 
                $rInstance = new \ReflectionProperty(
-                       'MediaWiki\\Session\\SessionManager', 'instance'
+                       SessionManager::class, 'instance'
                );
                $rInstance->setAccessible( true );
                $rGlobalSession = new \ReflectionProperty(
-                       'MediaWiki\\Session\\SessionManager', 'globalSession'
+                       SessionManager::class, 'globalSession'
                );
                $rGlobalSession->setAccessible( true );
                $rGlobalSessionRequest = new \ReflectionProperty(
-                       'MediaWiki\\Session\\SessionManager', 'globalSessionRequest'
+                       SessionManager::class, 'globalSessionRequest'
                );
                $rGlobalSessionRequest->setAccessible( true );
 
@@ -45,7 +45,7 @@ class TestUtils {
                        PHPSessionHandler::install( $manager );
                }
 
-               return new \ScopedCallback( function () use ( &$reset, $oldInstance ) {
+               return new \Wikimedia\ScopedCallback( function () use ( &$reset, $oldInstance ) {
                        foreach ( $reset as &$arr ) {
                                $arr[0]->setValue( $arr[1] );
                        }
@@ -62,7 +62,7 @@ class TestUtils {
         *  fields necessary.
         */
        public static function getDummySessionBackend() {
-               $rc = new \ReflectionClass( 'MediaWiki\\Session\\SessionBackend' );
+               $rc = new \ReflectionClass( SessionBackend::class );
                if ( !method_exists( $rc, 'newInstanceWithoutConstructor' ) ) {
                        \PHPUnit_Framework_Assert::markTestSkipped(
                                'ReflectionClass::newInstanceWithoutConstructor isn\'t available'
@@ -83,7 +83,7 @@ class TestUtils {
         * @return Session
         */
        public static function getDummySession( $backend = null, $index = -1, $logger = null ) {
-               $rc = new \ReflectionClass( 'MediaWiki\\Session\\Session' );
+               $rc = new \ReflectionClass( Session::class );
                if ( !method_exists( $rc, 'newInstanceWithoutConstructor' ) ) {
                        \PHPUnit_Framework_Assert::markTestSkipped(
                                'ReflectionClass::newInstanceWithoutConstructor isn\'t available'