X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fconfig%2FConfigFactoryTest.php;h=ea747afac14fee51573536718ceee4f92ca95fc0;hb=faf7cc4a09848c538320bd2b9067b1a77c0a0183;hp=c0e51d7e2dad22d2126a34805376f3bdb55ed03a;hpb=a29a4a491aa4088bc16255cde0e1da38977643a4;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/config/ConfigFactoryTest.php b/tests/phpunit/includes/config/ConfigFactoryTest.php index c0e51d7e2d..ea747afac1 100644 --- a/tests/phpunit/includes/config/ConfigFactoryTest.php +++ b/tests/phpunit/includes/config/ConfigFactoryTest.php @@ -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' ) ); } }