Umherirrender has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/374036 )
Change subject: phpunit: replace deprecated strict=true
......................................................................
phpunit: replace deprecated strict=true
Each run shows:
Warning: Deprecated configuration setting "strict" used
strict is deprecated in PHPUnit 4.8, internally it adds five options +
one to mark its use as deprecated:
$result['reportUselessTests'] = $flag;
$result['strictCoverage'] = $flag;
$result['disallowTestOutput'] = $flag;
$result['enforceTimeLimit'] = $flag;
$result['disallowTodoAnnotatedTests'] = $flag;
$result['deprecatedStrictModeSetting'] = true;
In phpunit.xml replace strict=yes and add the appropriate options.
Remove verbose=true and rename data provider to avoid risky test
Change-Id: Ibcc8b0704bbf84e39c883a014817b0248703c65a
---
M MediaWiki/Tests/MediaWikiStandardTest.php
M phpunit.xml.dist
2 files changed, 11 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer
refs/changes/36/374036/1
diff --git a/MediaWiki/Tests/MediaWikiStandardTest.php
b/MediaWiki/Tests/MediaWikiStandardTest.php
index 81db88f..f4bf5d7 100644
--- a/MediaWiki/Tests/MediaWikiStandardTest.php
+++ b/MediaWiki/Tests/MediaWikiStandardTest.php
@@ -50,7 +50,7 @@
* file against an expected output.
* @return array $tests The test string[].
*/
- public static function testProvider() {
+ public static function fileDataProvider() {
$tests = [];
$standard = dirname( __DIR__ );
@@ -77,7 +77,7 @@
/**
* _testFile
*
- * @dataProvider testProvider
+ * @dataProvider fileDataProvider
*
* @param string $file The path string of file.
* @param string $standard The standard string.
@@ -89,11 +89,12 @@
$expect = $this->prepareOutput( file_get_contents(
$expectedOutputFile ) );
$this->assertEquals( $expect, $outputStr );
}
+
/**
* @return array $tests The array of test.
*/
- public static function testFixProvider() {
- $tests = self::testProvider();
+ public static function fixDataProvider() {
+ $tests = self::fileDataProvider();
foreach ( array_keys( $tests ) as $idx ) {
$fixed = $tests[$idx][0] . ".fixed";
if ( file_exists( $fixed ) ) {
@@ -108,7 +109,7 @@
}
/**
- * @dataProvider testFixProvider
+ * @dataProvider fixDataProvider
* @param string $file The path of file.
* @param string $standard The standard string.
* @param string $fixedFile The path of fixed file.
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index d056159..4e4554f 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -5,8 +5,11 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
mapTestClassNameToCoveredClassName="false"
- strict="false"
- verbose="false"
+ beStrictAboutOutputDuringTests="true"
+ beStrictAboutTestSize="true"
+ beStrictAboutTestsThatDoNotTestAnything="true"
+ checkForUnintentionallyCoveredCode="true"
+ disallowTodoAnnotatedTests="true"
bootstrap="./phpunit.bootstrap.php">
<testsuites>
<testsuite name="phpcs/MediaWiki">
--
To view, visit https://gerrit.wikimedia.org/r/374036
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibcc8b0704bbf84e39c883a014817b0248703c65a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits