From 4193700b1992daaa76a6d09bbce6ca136f6a06f4 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 23 Feb 2016 03:18:31 +0000 Subject: [PATCH] Add missing namespace to @covers comments PHP_CodeCoverage_Exception: > Trying to @cover not existing method "SwiftFileBackend::sanitzeHdrs". > Trying to @cover not existing method "LineFormatter::normalizeException". > Trying to @cover not existing method "MonologSpi::mergeConfig". > Trying to @cover not existing method "ProcessCacheLRU::het". > Trying to @cover not existing method "BitmapHandler::swapICCProfile". > Trying to @cover not existing class or interface "checkParseSafety". > Trying to @cover not existing method "Article::__call". (was removed). > Trying to @cover not existing method "ExtensionProcessor::extracttExtensionMessagesFiles". > Trying to @cover not existing method "FileContentsHasher::getFileContentHash". Makes code coverage run fail at the moment. These used to be warnings in PHPUnit 3.x, but are now hard exceptions in PHPUnit 4.x when requesting a coverage report. Change-Id: If7f45ca57fd7d480d35b1414a889398837c0c472 --- tests/phpunit/includes/debug/logger/MonologSpiTest.php | 2 +- .../debug/logger/monolog/LineFormatterTest.php | 4 ++-- .../includes/filebackend/SwiftFileBackendTest.php | 8 ++++---- tests/phpunit/includes/libs/ProcessCacheLRUTest.php | 4 ++-- tests/phpunit/includes/media/ExifBitmapTest.php | 2 +- tests/phpunit/includes/media/XMPTest.php | 2 +- tests/phpunit/includes/page/ArticleTest.php | 10 ---------- .../includes/registration/ExtensionProcessorTest.php | 8 ++++---- .../phpunit/includes/utils/FileContentsHasherTest.php | 4 ++-- 9 files changed, 17 insertions(+), 27 deletions(-) diff --git a/tests/phpunit/includes/debug/logger/MonologSpiTest.php b/tests/phpunit/includes/debug/logger/MonologSpiTest.php index 206362fb58..0ee7d26884 100644 --- a/tests/phpunit/includes/debug/logger/MonologSpiTest.php +++ b/tests/phpunit/includes/debug/logger/MonologSpiTest.php @@ -26,7 +26,7 @@ use TestingAccessWrapper; class MonologSpiTest extends MediaWikiTestCase { /** - * @covers MonologSpi::mergeConfig + * @covers MediaWiki\Logger\MonologSpi::mergeConfig */ public function testMergeConfig() { $base = [ diff --git a/tests/phpunit/includes/debug/logger/monolog/LineFormatterTest.php b/tests/phpunit/includes/debug/logger/monolog/LineFormatterTest.php index be23c4a210..f33cf7e05d 100644 --- a/tests/phpunit/includes/debug/logger/monolog/LineFormatterTest.php +++ b/tests/phpunit/includes/debug/logger/monolog/LineFormatterTest.php @@ -36,7 +36,7 @@ class LineFormatterTest extends MediaWikiTestCase { } /** - * @covers LineFormatter::normalizeException + * @covers MediaWiki\Logger\Monolog\LineFormatter::normalizeException */ public function testNormalizeExceptionNoTrace() { $fixture = new LineFormatter(); @@ -55,7 +55,7 @@ class LineFormatterTest extends MediaWikiTestCase { } /** - * @covers LineFormatter::normalizeException + * @covers MediaWiki\Logger\Monolog\LineFormatter::normalizeException */ public function testNormalizeExceptionTrace() { $fixture = new LineFormatter(); diff --git a/tests/phpunit/includes/filebackend/SwiftFileBackendTest.php b/tests/phpunit/includes/filebackend/SwiftFileBackendTest.php index 4f47f32a34..95ffb7057b 100644 --- a/tests/phpunit/includes/filebackend/SwiftFileBackendTest.php +++ b/tests/phpunit/includes/filebackend/SwiftFileBackendTest.php @@ -27,17 +27,17 @@ class SwiftFileBackendTest extends MediaWikiTestCase { } /** - * @dataProvider provider_testSanitzeHdrs - * @covers SwiftFileBackend::sanitzeHdrs + * @dataProvider provider_testSanitizeHdrs + * @covers SwiftFileBackend::sanitizeHdrs * @covers SwiftFileBackend::getCustomHeaders */ - public function testSanitzeHdrs( $raw, $sanitized ) { + public function testSanitizeHdrs( $raw, $sanitized ) { $hdrs = $this->backend->sanitizeHdrs( [ 'headers' => $raw ] ); $this->assertEquals( $hdrs, $sanitized, 'sanitizeHdrs() has expected result' ); } - public static function provider_testSanitzeHdrs() { + public static function provider_testSanitizeHdrs() { return [ [ [ diff --git a/tests/phpunit/includes/libs/ProcessCacheLRUTest.php b/tests/phpunit/includes/libs/ProcessCacheLRUTest.php index a579f3ac81..9c189d1293 100644 --- a/tests/phpunit/includes/libs/ProcessCacheLRUTest.php +++ b/tests/phpunit/includes/libs/ProcessCacheLRUTest.php @@ -94,7 +94,7 @@ class ProcessCacheLRUTest extends PHPUnit_Framework_TestCase { /** * @covers ProcessCacheLRU::get * @covers ProcessCacheLRU::set - * @covers ProcessCacheLRU::het + * @covers ProcessCacheLRU::has */ public function testAddAndGetAKey() { $oneCache = new ProcessCacheLRUTestable( 1 ); @@ -184,7 +184,7 @@ class ProcessCacheLRUTest extends PHPUnit_Framework_TestCase { /** * @covers ProcessCacheLRU::get * @covers ProcessCacheLRU::set - * @covers ProcessCacheLRU::het + * @covers ProcessCacheLRU::has */ public function testRecentlyAccessedKeyStickIn() { $cache = new ProcessCacheLRUTestable( 2 ); diff --git a/tests/phpunit/includes/media/ExifBitmapTest.php b/tests/phpunit/includes/media/ExifBitmapTest.php index b777ed06ee..f70b42de42 100644 --- a/tests/phpunit/includes/media/ExifBitmapTest.php +++ b/tests/phpunit/includes/media/ExifBitmapTest.php @@ -146,7 +146,7 @@ class ExifBitmapTest extends MediaWikiMediaTestCase { /** * @dataProvider provideSwappingICCProfile - * @covers BitmapHandler::swapICCProfile + * @covers ExifBitmapHandler::swapICCProfile */ public function testSwappingICCProfile( $sourceFilename, $controlFilename, $newProfileFilename, $oldProfileName diff --git a/tests/phpunit/includes/media/XMPTest.php b/tests/phpunit/includes/media/XMPTest.php index dacef8dba6..bffe415c5d 100644 --- a/tests/phpunit/includes/media/XMPTest.php +++ b/tests/phpunit/includes/media/XMPTest.php @@ -175,7 +175,7 @@ class XMPTest extends MediaWikiTestCase { /** * Test for multi-section, hostile XML - * @covers checkParseSafety + * @covers XMPReader::checkParseSafety */ public function testCheckParseSafety() { diff --git a/tests/phpunit/includes/page/ArticleTest.php b/tests/phpunit/includes/page/ArticleTest.php index ae069eaf42..a96a2960fb 100644 --- a/tests/phpunit/includes/page/ArticleTest.php +++ b/tests/phpunit/includes/page/ArticleTest.php @@ -41,16 +41,6 @@ class ArticleTest extends MediaWikiTestCase { $this->assertEquals( 2, $this->article->mLatest, "Article __set magic" ); } - /** - * @depends testImplementsSetMagic - * @covers Article::__call - */ - public function testImplementsCallMagic() { - $this->article->mLatest = 33; - $this->article->mDataLoaded = true; - $this->assertEquals( 33, $this->article->getLatest(), "Article __call magic" ); - } - /** * @covers Article::__get * @covers Article::__set diff --git a/tests/phpunit/includes/registration/ExtensionProcessorTest.php b/tests/phpunit/includes/registration/ExtensionProcessorTest.php index 35aca48f44..27c0c60686 100644 --- a/tests/phpunit/includes/registration/ExtensionProcessorTest.php +++ b/tests/phpunit/includes/registration/ExtensionProcessorTest.php @@ -130,7 +130,7 @@ class ExtensionProcessorTest extends MediaWikiTestCase { $this->assertEquals( 'somevalue', $extracted['globals']['egBar'] ); } - public static function provideExtracttExtensionMessagesFiles() { + public static function provideExtractExtensionMessagesFiles() { $dir = __DIR__ . '/FooBar/'; return [ [ @@ -155,10 +155,10 @@ class ExtensionProcessorTest extends MediaWikiTestCase { } /** - * @covers ExtensionProcessor::extracttExtensionMessagesFiles - * @dataProvider provideExtracttExtensionMessagesFiles + * @covers ExtensionProcessor::extractExtensionMessagesFiles + * @dataProvider provideExtractExtensionMessagesFiles */ - public function testExtracttExtensionMessagesFiles( $input, $expected ) { + public function testExtractExtensionMessagesFiles( $input, $expected ) { $processor = new ExtensionProcessor(); $processor->extractInfo( $this->dir, $input + self::$default, 1 ); $out = $processor->getExtractedInfo(); diff --git a/tests/phpunit/includes/utils/FileContentsHasherTest.php b/tests/phpunit/includes/utils/FileContentsHasherTest.php index db18b723fa..2de4bffbe6 100644 --- a/tests/phpunit/includes/utils/FileContentsHasherTest.php +++ b/tests/phpunit/includes/utils/FileContentsHasherTest.php @@ -18,7 +18,7 @@ class FileContentsHasherTest extends MediaWikiTestCase { } /** - * @covers FileContentsHasher::getFileContentHash + * @covers FileContentsHasher::getFileContentsHash * @covers FileContentsHasher::getFileContentsHashInternal * @dataProvider provideSingleFile */ @@ -33,7 +33,7 @@ class FileContentsHasherTest extends MediaWikiTestCase { } /** - * @covers FileContentsHasher::getFileContentHash + * @covers FileContentsHasher::getFileContentsHash * @covers FileContentsHasher::getFileContentsHashInternal * @dataProvider provideMultipleFiles */ -- 2.20.1