From: Timo Tijhof Date: Fri, 4 May 2018 16:30:33 +0000 (+0100) Subject: resourceloader: Improve coverage of SkinModule X-Git-Tag: 1.34.0-rc.0~5525^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=b6a2e22acdedaa9e6fa827a7217945390c94ac1f;p=lhc%2Fweb%2Fwiklou.git resourceloader: Improve coverage of SkinModule * Ignore getLogoData() which is a one-line proxy to ::getLogo, that can't really be tested because static methods can't be stubbed. It exists so that this method can be stubbed instead. The actual method is already covered. * Simplify @covers for getStyles() to allow indirect coverage within the class because it's intended as a higher-level integration tests. The other tests in the suite still cover a specific method only. Change-Id: I1445a016c1f12a6d8ceaaf745023a28cf20e5371 --- diff --git a/includes/resourceloader/ResourceLoaderSkinModule.php b/includes/resourceloader/ResourceLoaderSkinModule.php index fbd0a24a7f..de25d32e54 100644 --- a/includes/resourceloader/ResourceLoaderSkinModule.php +++ b/includes/resourceloader/ResourceLoaderSkinModule.php @@ -93,6 +93,9 @@ class ResourceLoaderSkinModule extends ResourceLoaderFileModule { } /** + * Non-static proxy to ::getLogo (for overloading in sub classes or tests). + * + * @codeCoverageIgnore * @since 1.31 * @param Config $conf * @return string|array diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php index a1b1422060..61ab8a521d 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php @@ -71,8 +71,7 @@ CSS /** * @dataProvider provideGetStyles - * @covers ResourceLoaderSkinModule::normalizeStyles - * @covers ResourceLoaderSkinModule::getStyles + * @covers ResourceLoaderSkinModule */ public function testGetStyles( $parent, $logo, $expected ) { $module = $this->getMockBuilder( ResourceLoaderSkinModule::class )