Skip to content

Commit 7abe779

Browse files
Deprecate --strict option
1 parent 1ec8d7d commit 7abe779

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed

src/TextUI/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ protected function handleArguments(array $argv)
512512
$this->arguments['disallowTestOutput'] = true;
513513
$this->arguments['enforceTimeLimit'] = true;
514514
$this->arguments['disallowTodoAnnotatedTests'] = true;
515+
$this->arguments['deprecatedStrictModeOption'] = true;
515516
}
516517
break;
517518

@@ -906,7 +907,6 @@ protected function showHelp()
906907
--disallow-test-output Be strict about output during tests.
907908
--enforce-time-limit Enforce time limit based on test size.
908909
--disallow-todo-tests Disallow @todo-annotated tests.
909-
--strict Run tests in strict mode (enables all of the above).
910910
911911
--process-isolation Run each test in a separate PHP process.
912912
--no-globals-backup Do not backup and restore \$GLOBALS for each test.

src/TextUI/TestRunner.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,14 @@ class_exists($arguments['printer'], false)) {
253253
)
254254
);
255255
}
256+
257+
if (isset($arguments['deprecatedStrictModeOption'])) {
258+
print "Deprecated option \"--strict\" used\n\n";
259+
}
260+
261+
if (isset($arguments['deprecatedStrictModeSetting'])) {
262+
print "Deprecated configuration setting \"strict\" used\n\n";
263+
}
256264
}
257265

258266
foreach ($arguments['listeners'] as $listener) {
@@ -564,6 +572,10 @@ protected function handleConfiguration(array &$arguments)
564572

565573
$phpunitConfiguration = $arguments['configuration']->getPHPUnitConfiguration();
566574

575+
if (isset($phpunitConfiguration['deprecatedStrictModeSetting'])) {
576+
$arguments['deprecatedStrictModeSetting'] = true;
577+
}
578+
567579
if (isset($phpunitConfiguration['backupGlobals']) &&
568580
!isset($arguments['backupGlobals'])) {
569581
$arguments['backupGlobals'] = $phpunitConfiguration['backupGlobals'];

src/Util/Configuration.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -731,11 +731,12 @@ public function getPHPUnitConfiguration()
731731
(string) $root->getAttribute('strict'), false
732732
);
733733

734-
$result['reportUselessTests'] = $flag;
735-
$result['strictCoverage'] = $flag;
736-
$result['disallowTestOutput'] = $flag;
737-
$result['enforceTimeLimit'] = $flag;
738-
$result['disallowTodoAnnotatedTests'] = $flag;
734+
$result['reportUselessTests'] = $flag;
735+
$result['strictCoverage'] = $flag;
736+
$result['disallowTestOutput'] = $flag;
737+
$result['enforceTimeLimit'] = $flag;
738+
$result['disallowTodoAnnotatedTests'] = $flag;
739+
$result['deprecatedStrictModeSetting'] = true;
739740
}
740741

741742
if ($root->hasAttribute('verbose')) {

tests/TextUI/help.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ Test Execution Options:
4848
--disallow-test-output Be strict about output during tests.
4949
--enforce-time-limit Enforce time limit based on test size.
5050
--disallow-todo-tests Disallow @todo-annotated tests.
51-
--strict Run tests in strict mode (enables all of the above).
5251

5352
--process-isolation Run each test in a separate PHP process.
5453
--no-globals-backup Do not backup and restore $GLOBALS for each test.

tests/TextUI/help2.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ Test Execution Options:
4949
--disallow-test-output Be strict about output during tests.
5050
--enforce-time-limit Enforce time limit based on test size.
5151
--disallow-todo-tests Disallow @todo-annotated tests.
52-
--strict Run tests in strict mode (enables all of the above).
5352

5453
--process-isolation Run each test in a separate PHP process.
5554
--no-globals-backup Do not backup and restore $GLOBALS for each test.

tests/_files/configuration_xinclude.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
timeoutForSmallTests="1"
1919
timeoutForMediumTests="10"
2020
timeoutForLargeTests="60"
21-
strict="false"
21+
beStrictAboutTestsThatDoNotTestAnything="false"
22+
beStrictAboutOutputDuringTests="false"
23+
beStrictAboutTestSize="false"
24+
beStrictAboutTodoAnnotatedTests="false"
25+
checkForUnintentionallyCoveredCode="false"
2226
verbose="false">
2327
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
2428
href="configuration.xml"

0 commit comments

Comments
 (0)