summaryrefslogtreecommitdiffstats
path: root/core/scripts
diff options
context:
space:
mode:
authorNathaniel Catchpole2017-11-09 12:51:06 (GMT)
committerNathaniel Catchpole2017-11-09 12:51:06 (GMT)
commit75dcf9af4425942240f221cbff8a9220a6e6df0a (patch)
tree4b7683c57c48c74f7fc00408d066715342f99da9 /core/scripts
parentb83782a74b0fa73c9e172537fbd52b7155e49909 (diff)
Issue #2870194 by alexpott, Mile23, jibran, larowlan, tim.plunkett: Ensure that process-isolated tests can use Symfony's PHPunit bridge to catch usages of deprecated code
Diffstat (limited to 'core/scripts')
-rwxr-xr-xcore/scripts/run-tests.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 09a7aad..5ebf9f0 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -305,6 +305,10 @@ All arguments are long options.
--non-html Removes escaping from output. Useful for reading results on the
CLI.
+ --suppress-deprecations
+
+ Stops tests from failing if deprecation errors are triggered.
+
<test1>[,<test2>[,<test3> ...]]
One or more tests to be run. By default, these are interpreted
@@ -369,6 +373,7 @@ function simpletest_script_parse_args() {
'test_names' => array(),
'repeat' => 1,
'die-on-fail' => FALSE,
+ 'suppress-deprecations' => FALSE,
'browser' => FALSE,
// Used internally.
'test-id' => 0,
@@ -784,6 +789,12 @@ function simpletest_script_run_one_test($test_id, $test_class) {
$methods = array();
}
$test = new $class_name($test_id);
+ if ($args['suppress-deprecations']) {
+ putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');
+ }
+ else {
+ putenv('SYMFONY_DEPRECATIONS_HELPER=strict');
+ }
if (is_subclass_of($test_class, TestCase::class)) {
$status = simpletest_script_run_phpunit($test_id, $test_class);
}
@@ -834,7 +845,7 @@ function simpletest_script_command($test_id, $test_class) {
}
$command .= ' --php ' . escapeshellarg($php);
$command .= " --test-id $test_id";
- foreach (array('verbose', 'keep-results', 'color', 'die-on-fail') as $arg) {
+ foreach (array('verbose', 'keep-results', 'color', 'die-on-fail', 'suppress-deprecations') as $arg) {
if ($args[$arg]) {
$command .= ' --' . $arg;
}