resourceloader: Improve coverage of SkinModule
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 4 May 2018 16:30:33 +0000 (17:30 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 4 May 2018 16:31:04 +0000 (17:31 +0100)
* 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

includes/resourceloader/ResourceLoaderSkinModule.php
tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php

index fbd0a24..de25d32 100644 (file)
@@ -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
index a1b1422..61ab8a5 100644 (file)
@@ -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 )