summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorAnthony Ferrara <ircmaxell@php.net>2012-07-06 22:39:32 -0400
committerAnthony Ferrara <ircmaxell@php.net>2012-07-06 22:39:32 -0400
commit6abd7365d041f07ab2ac16de22091e6b3065d69b (patch)
tree7750909dcadd234dbfd2838bf83842c3ec474b15 /run-tests.php
parented54357fcded8849c6830fa80b42bdde4650fdb8 (diff)
parent79ed100c19667ecf8b8fcb445bd52bf8c22cee0a (diff)
downloadphp-git-6abd7365d041f07ab2ac16de22091e6b3065d69b.tar.gz
Merge branch 'PHP-5.4'
* PHP-5.4: Fix two issues with run-tests.php
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/run-tests.php b/run-tests.php
index c760c61bc1..3997a067c7 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -2671,12 +2671,15 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag
$time = null !== $time ? $time : junit_get_timer($file_name);
junit_suite_record($suite, 'execution_time', $time);
+ $escaped_details = htmlspecialchars($details, ENT_QUOTES, 'UTF-8');
+
$escaped_test_name = basename($file_name) . ' - ' . htmlspecialchars($test_name, ENT_QUOTES);
$JUNIT['files'][$file_name]['xml'] = "<testcase classname='$suite' name='$escaped_test_name' time='$time'>\n";
if (is_array($type)) {
$output_type = $type[0] . 'ED';
- $type = reset(array_intersect(array('XFAIL', 'FAIL'), $type));
+ $temp = array_intersect(array('XFAIL', 'FAIL'), $type);
+ $type = reset($temp);
} else {
$output_type = $type . 'ED';
}
@@ -2691,10 +2694,10 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag
$JUNIT['files'][$file_name]['xml'] .= "<skipped>$message</skipped>\n";
} elseif('FAIL' == $type) {
junit_suite_record($suite, 'test_fail');
- $JUNIT['files'][$file_name]['xml'] .= "<failure type='$output_type' message='$message'>$details</failure>\n";
+ $JUNIT['files'][$file_name]['xml'] .= "<failure type='$output_type' message='$message'>$escaped_details</failure>\n";
} else {
junit_suite_record($suite, 'test_error');
- $JUNIT['files'][$file_name]['xml'] .= "<error type='$output_type' message='$message'>$details</error>\n";
+ $JUNIT['files'][$file_name]['xml'] .= "<error type='$output_type' message='$message'>$escaped_details</error>\n";
}
$JUNIT['files'][$file_name]['xml'] .= "</testcase>\n";