Use ::class to resolve class names in tests
[lhc/web/wiklou.git] / tests / phpunit / includes / config / ConfigFactoryTest.php
index c0e51d7..ea747af 100644 (file)
@@ -18,7 +18,7 @@ class ConfigFactoryTest extends MediaWikiTestCase {
         */
        public function testRegisterInvalid() {
                $factory = new ConfigFactory();
-               $this->setExpectedException( 'InvalidArgumentException' );
+               $this->setExpectedException( InvalidArgumentException::class );
                $factory->register( 'invalid', 'Invalid callback' );
        }
 
@@ -87,7 +87,7 @@ class ConfigFactoryTest extends MediaWikiTestCase {
                $this->assertNotSame( $bar, $newBar, 'don\'t salvage if callbacks differ' );
 
                // the new factory doesn't have quux defined, so the quux instance should not be salvaged
-               $this->setExpectedException( 'ConfigException' );
+               $this->setExpectedException( ConfigException::class );
                $newFactory->makeConfig( 'quux' );
        }
 
@@ -110,7 +110,7 @@ class ConfigFactoryTest extends MediaWikiTestCase {
                $factory->register( 'unittest', 'GlobalVarConfig::newInstance' );
 
                $conf = $factory->makeConfig( 'unittest' );
-               $this->assertInstanceOf( 'Config', $conf );
+               $this->assertInstanceOf( Config::class, $conf );
                $this->assertSame( $conf, $factory->makeConfig( 'unittest' ) );
        }
 
@@ -131,7 +131,7 @@ class ConfigFactoryTest extends MediaWikiTestCase {
                $factory = new ConfigFactory();
                $factory->register( '*', 'GlobalVarConfig::newInstance' );
                $conf = $factory->makeConfig( 'unittest' );
-               $this->assertInstanceOf( 'Config', $conf );
+               $this->assertInstanceOf( Config::class, $conf );
        }
 
        /**
@@ -139,7 +139,7 @@ class ConfigFactoryTest extends MediaWikiTestCase {
         */
        public function testMakeConfigWithNoBuilders() {
                $factory = new ConfigFactory();
-               $this->setExpectedException( 'ConfigException' );
+               $this->setExpectedException( ConfigException::class );
                $factory->makeConfig( 'nobuilderregistered' );
        }
 
@@ -151,7 +151,7 @@ class ConfigFactoryTest extends MediaWikiTestCase {
                $factory->register( 'unittest', function () {
                        return true; // Not a Config object
                } );
-               $this->setExpectedException( 'UnexpectedValueException' );
+               $this->setExpectedException( UnexpectedValueException::class );
                $factory->makeConfig( 'unittest' );
        }
 
@@ -162,7 +162,7 @@ class ConfigFactoryTest extends MediaWikiTestCase {
                // NOTE: the global config factory returned here has been overwritten
                // for operation in test mode. It may not reflect LocalSettings.
                $factory = MediaWikiServices::getInstance()->getConfigFactory();
-               $this->assertInstanceOf( 'Config', $factory->makeConfig( 'main' ) );
+               $this->assertInstanceOf( Config::class, $factory->makeConfig( 'main' ) );
        }
 
 }