From da6235ce3a426effc7dc4d30a6c638c9ddd1886f Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 27 Jul 2017 21:40:21 -0700 Subject: [PATCH] resourceloader: Fix @covers for CSSMin tests Change-Id: Idb451d244fbdfbb218a56c2953298b7fe29ed3d4 --- includes/libs/CSSMin.php | 3 +++ tests/phpunit/includes/libs/CSSMinTest.php | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index 4c672f4644..cd80066558 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -384,6 +384,9 @@ class CSSMin { return false; } + /** + * @codeCoverageIgnore + */ private static function getUrlRegex() { static $urlRegex; if ( $urlRegex === null ) { diff --git a/tests/phpunit/includes/libs/CSSMinTest.php b/tests/phpunit/includes/libs/CSSMinTest.php index 1a15c2607d..7d9a420c73 100644 --- a/tests/phpunit/includes/libs/CSSMinTest.php +++ b/tests/phpunit/includes/libs/CSSMinTest.php @@ -24,6 +24,7 @@ class CSSMinTest extends MediaWikiTestCase { /** * @dataProvider mimeTypeProvider + * @covers CSSMin::getMimeType */ public function testGetMimeType( $fileContents, $fileExtension, $expected ) { $fileName = wfTempDir() . DIRECTORY_SEPARATOR . uniqid( 'MW_PHPUnit_CSSMinTest_' ) . '.' @@ -167,7 +168,7 @@ class CSSMinTest extends MediaWikiTestCase { /** * @dataProvider provideIsRemoteUrl - * @cover CSSMin::isRemoteUrl + * @covers CSSMin::isRemoteUrl */ public function testIsRemoteUrl( $expect, $url ) { $this->assertEquals( CSSMinTestable::isRemoteUrl( $url ), $expect ); @@ -184,18 +185,19 @@ class CSSMinTest extends MediaWikiTestCase { /** * @dataProvider provideIsLocalUrls - * @cover CSSMin::isLocalUrl + * @covers CSSMin::isLocalUrl */ public function testIsLocalUrl( $expect, $url ) { $this->assertEquals( CSSMinTestable::isLocalUrl( $url ), $expect ); } /** - * This tests funky parameters to CSSMin::remap. testRemapRemapping tests - * the basic functionality. + * This test tests funky parameters to CSSMin::remap. * + * @see testRemapRemapping for testing of the basic functionality * @dataProvider provideRemapCases * @covers CSSMin::remap + * @covers CSSMin::remapOne */ public function testRemap( $message, $params, $expectedOutput ) { $remapped = call_user_func_array( 'CSSMin::remap', $params ); @@ -246,10 +248,11 @@ class CSSMinTest extends MediaWikiTestCase { } /** - * This tests basic functionality of CSSMin::remap. testRemapRemapping tests funky parameters. + * This tests the basic functionality of CSSMin::remap. * + * @see testRemap for testing of funky parameters * @dataProvider provideRemapRemappingCases - * @covers CSSMin::remap + * @covers CSSMin */ public function testRemapRemapping( $message, $input, $expectedOutput ) { $localPath = __DIR__ . '/../../data/cssmin'; -- 2.20.1