if ($sum_results['FAILED']) {
foreach ($PHP_FAILED_TESTS['FAILED'] as $test_info) {
$failed_tests_data .= $sep . $test_info['name'] . $test_info['info'];
- $failed_tests_data .= $sep . file_get_contents(realpath($test_info['output']), FILE_BINARY);
- $failed_tests_data .= $sep . file_get_contents(realpath($test_info['diff']), FILE_BINARY);
+ $failed_tests_data .= $sep . file_get_contents(realpath($test_info['output']));
+ $failed_tests_data .= $sep . file_get_contents(realpath($test_info['diff']));
$failed_tests_data .= $sep . "\n\n";
}
$status = "failed";
global $DETAILED;
if ($filename_copy && $filename_copy != $filename) {
- if (file_put_contents($filename_copy, $text, FILE_BINARY) === false) {
+ if (file_put_contents($filename_copy, $text) === false) {
error("Cannot open file '" . $filename_copy . "' (save_text)");
}
}
- if (file_put_contents($filename, $text, FILE_BINARY) === false) {
+ if (file_put_contents($filename, $text) === false) {
error("Cannot open file '" . $filename . "' (save_text)");
}
$section_text[$key] = dirname($file) . '/' . trim(str_replace('..', '', $section_text[$key]));
if (file_exists($section_text[$key])) {
- $section_text[$prefix] = file_get_contents($section_text[$key], FILE_BINARY);
+ $section_text[$prefix] = file_get_contents($section_text[$key]);
unset($section_text[$key]);
} else {
$bork_info = "could not load --" . $key . "-- " . dirname($file) . '/' . trim($section_text[$key]);
if (!$passed) {
// write .exp
- if (strpos($log_format, 'E') !== false && file_put_contents($exp_filename, $wanted, FILE_BINARY) === false) {
+ if (strpos($log_format, 'E') !== false && file_put_contents($exp_filename, $wanted) === false) {
error("Cannot create expected test output - $exp_filename");
}
// write .out
- if (strpos($log_format, 'O') !== false && file_put_contents($output_filename, $output, FILE_BINARY) === false) {
+ if (strpos($log_format, 'O') !== false && file_put_contents($output_filename, $output) === false) {
error("Cannot create test output - $output_filename");
}
$diff = "# original source file: $orig_shortname\n" . $diff;
}
show_file_block('diff', $diff);
- if (strpos($log_format, 'D') !== false && file_put_contents($diff_filename, $diff, FILE_BINARY) === false) {
+ if (strpos($log_format, 'D') !== false && file_put_contents($diff_filename, $diff) === false) {
error("Cannot create test diff - $diff_filename");
}
;;
esac
SH;
- if (strpos($log_format, 'S') !== false && file_put_contents($sh_filename, $sh_script, FILE_BINARY) === false) {
+ if (strpos($log_format, 'S') !== false && file_put_contents($sh_filename, $sh_script) === false) {
error("Cannot create test shell script - $sh_filename");
}
chmod($sh_filename, 0755);
---- ACTUAL OUTPUT
$output
---- FAILED
-", FILE_BINARY) === false) {
+") === false) {
error("Cannot create test log - $log_filename");
error_report($file, $log_filename, $tested);
}