From: Kunal Mehta Date: Mon, 3 Jun 2019 00:58:58 +0000 (-0400) Subject: Use ExtensionRegistry::setAttributeForTest() instead of Reflection X-Git-Tag: 1.34.0-rc.0~1537^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/Special:FilePath/Image2.gif?a=commitdiff_plain;h=2de2e056a8badc40ee7b282b7929c019953b4f45;p=lhc%2Fweb%2Fwiklou.git Use ExtensionRegistry::setAttributeForTest() instead of Reflection Change-Id: If29e8825f1734f8c0efa21aa77f6354fa3468248 --- diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderOOUIImageModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderOOUIImageModuleTest.php index ff09660faa..5df52bc422 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderOOUIImageModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderOOUIImageModuleTest.php @@ -25,20 +25,9 @@ class ResourceLoaderOOUIImageModuleTest extends ResourceLoaderTestCase { ); $this->setService( 'SkinFactory', $skinFactory ); - $r = new ReflectionMethod( ExtensionRegistry::class, 'exportExtractedData' ); - $r->setAccessible( true ); - $r->invoke( ExtensionRegistry::getInstance(), [ - 'globals' => [], - 'defines' => [], - 'callbacks' => [], - 'credits' => [], - 'autoloaderPaths' => [], - 'attributes' => [ - 'SkinOOUIThemes' => [ - 'fakemonobook' => 'Apex', - ], - ], - ] ); + $reset = ExtensionRegistry::getInstance()->setAttributeForTest( + 'SkinOOUIThemes', [ 'fakemonobook' => 'Apex' ] + ); $styles = $module->getStyles( $this->getResourceLoaderContext( [ 'skin' => 'fakemonobook' ] ) ); $this->assertRegExp(