本文整理汇总了PHP中show_redirect_start函数的典型用法代码示例。如果您正苦于以下问题:PHP show_redirect_start函数的具体用法?PHP show_redirect_start怎么用?PHP show_redirect_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了show_redirect_start函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run_test
//.........这里部分代码省略.........
if (!strncasecmp('warn', ltrim($output), 4)) {
if (preg_match('/^\\s*warn\\s*(.+)\\s*/i', $output, $m)) {
$warn = true;
/* only if there is a reason */
$info = " (warn: {$m['1']})";
}
}
}
}
if (!extension_loaded("zlib") && (array_key_exists("GZIP_POST", $section_text) || array_key_exists("DEFLATE_POST", $section_text))) {
$message = "ext/zlib required";
show_result('SKIP', $tested, $tested_file, "reason: {$message}", $temp_filenames);
junit_mark_test_as('SKIP', $shortname, $tested, null, $message);
return 'SKIPPED';
}
if (@count($section_text['REDIRECTTEST']) == 1) {
$test_files = array();
$IN_REDIRECT = eval($section_text['REDIRECTTEST']);
$IN_REDIRECT['via'] = "via [{$shortname}]\n\t";
$IN_REDIRECT['dir'] = realpath(dirname($file));
$IN_REDIRECT['prefix'] = trim($section_text['TEST']);
if (!empty($IN_REDIRECT['TESTS'])) {
if (is_array($org_file)) {
$test_files[] = $org_file[1];
} else {
$GLOBALS['test_files'] = $test_files;
find_files($IN_REDIRECT['TESTS']);
foreach ($GLOBALS['test_files'] as $f) {
$test_files[] = array($f, $file);
}
}
$test_cnt += @count($test_files) - 1;
$test_idx--;
show_redirect_start($IN_REDIRECT['TESTS'], $tested, $tested_file);
// set up environment
$redirenv = array_merge($environment, $IN_REDIRECT['ENV']);
$redirenv['REDIR_TEST_DIR'] = realpath($IN_REDIRECT['TESTS']) . DIRECTORY_SEPARATOR;
usort($test_files, "test_sort");
run_all_tests($test_files, $redirenv, $tested);
show_redirect_ends($IN_REDIRECT['TESTS'], $tested, $tested_file);
// a redirected test never fails
$IN_REDIRECT = false;
junit_mark_test_as('PASS', $shortname, $tested);
return 'REDIR';
} else {
$bork_info = "Redirect info must contain exactly one TEST string to be used as redirect directory.";
show_result("BORK", $bork_info, '', $temp_filenames);
$PHP_FAILED_TESTS['BORKED'][] = array('name' => $file, 'test_name' => '', 'output' => '', 'diff' => '', 'info' => "{$bork_info} [{$file}]");
}
}
if (is_array($org_file) || @count($section_text['REDIRECTTEST']) == 1) {
if (is_array($org_file)) {
$file = $org_file[0];
}
$bork_info = "Redirected test did not contain redirection info";
show_result("BORK", $bork_info, '', $temp_filenames);
$PHP_FAILED_TESTS['BORKED'][] = array('name' => $file, 'test_name' => '', 'output' => '', 'diff' => '', 'info' => "{$bork_info} [{$file}]");
junit_mark_test_as('BORK', $shortname, $tested, null, $bork_info);
return 'BORKED';
}
// We've satisfied the preconditions - run the test!
if (isset($section_text['FILE'])) {
show_file_block('php', $section_text['FILE'], 'TEST');
save_text($test_file, $section_text['FILE'], $temp_file);
} else {
$test_file = $temp_file = "";
示例2: run_test
//.........这里部分代码省略.........
}
if (!strncasecmp('info', ltrim($output), 4)) {
if (preg_match('/^\\s*info\\s*(.+)\\s*/i', $output, $m)) {
$info = " (info: {$m['1']})";
}
}
if (!strncasecmp('warn', ltrim($output), 4)) {
if (preg_match('/^\\s*warn\\s*(.+)\\s*/i', $output, $m)) {
$warn = true;
/* only if there is a reason */
$info = " (warn: {$m['1']})";
}
}
}
}
if (@count($section_text['REDIRECTTEST']) == 1) {
$test_files = array();
$IN_REDIRECT = eval($section_text['REDIRECTTEST']);
$IN_REDIRECT['via'] = "via [{$shortname}]\n\t";
$IN_REDIRECT['dir'] = realpath(dirname($file));
$IN_REDIRECT['prefix'] = trim($section_text['TEST']);
if (count($IN_REDIRECT['TESTS']) == 1) {
if (is_array($org_file)) {
$test_files[] = $org_file[1];
} else {
$GLOBALS['test_files'] = $test_files;
find_files($IN_REDIRECT['TESTS']);
foreach ($GLOBALS['test_files'] as $f) {
$test_files[] = array($f, $file);
}
}
$test_cnt += @count($test_files) - 1;
$test_idx--;
show_redirect_start($IN_REDIRECT['TESTS'], $tested, $tested_file);
// set up environment
$redirenv = array_merge($environment, $IN_REDIRECT['ENV']);
$redirenv['REDIR_TEST_DIR'] = realpath($IN_REDIRECT['TESTS']) . DIRECTORY_SEPARATOR;
usort($test_files, "test_sort");
run_all_tests($test_files, $redirenv, $tested);
show_redirect_ends($IN_REDIRECT['TESTS'], $tested, $tested_file);
// a redirected test never fails
$IN_REDIRECT = false;
return 'REDIR';
} else {
$bork_info = "Redirect info must contain exactly one TEST string to be used as redirect directory.";
show_result("BORK", $bork_info, '', $temp_filenames);
$PHP_FAILED_TESTS['BORKED'][] = array('name' => $file, 'test_name' => '', 'output' => '', 'diff' => '', 'info' => "{$bork_info} [{$file}]");
}
}
if (is_array($org_file) || @count($section_text['REDIRECTTEST']) == 1) {
if (is_array($org_file)) {
$file = $org_file[0];
}
$bork_info = "Redirected test did not contain redirection info";
show_result("BORK", $bork_info, '', $temp_filenames);
$PHP_FAILED_TESTS['BORKED'][] = array('name' => $file, 'test_name' => '', 'output' => '', 'diff' => '', 'info' => "{$bork_info} [{$file}]");
return 'BORKED';
}
// We've satisfied the preconditions - run the test!
show_file_block('php', $section_text['FILE'], 'TEST');
save_text($test_file, $section_text['FILE'], $temp_file);
if (array_key_exists('GET', $section_text)) {
$query_string = trim($section_text['GET']);
} else {
$query_string = '';
}
示例3: run_test
//.........这里部分代码省略.........
$reason = ereg("^info[[:space:]]*(.+)\$", trim($output)) ? ereg_replace("^info[[:space:]]*(.+)\$", "\\1", trim($output)) : FALSE;
if ($reason) {
$info = " (info: {$reason})";
}
}
if (!strncasecmp('warn', trim($output), 4)) {
$reason = ereg("^warn[[:space:]]*(.+)\$", trim($output)) ? ereg_replace("^warn[[:space:]]*(.+)\$", "\\1", trim($output)) : FALSE;
if ($reason) {
$warn = true;
/* only if there is a reason */
$info = " (warn: {$reason})";
}
}
}
}
if (@count($section_text['REDIRECTTEST']) == 1) {
$test_files = array();
$IN_REDIRECT = eval($section_text['REDIRECTTEST']);
$IN_REDIRECT['via'] = "via [{$shortname}]\n\t";
$IN_REDIRECT['dir'] = realpath(dirname($file));
$IN_REDIRECT['prefix'] = trim($section_text['TEST']);
if (@count($IN_REDIRECT['TESTS']) == 1) {
if (is_array($org_file)) {
$test_files[] = $org_file[1];
} else {
$GLOBALS['test_files'] = $test_files;
find_files($IN_REDIRECT['TESTS']);
foreach ($GLOBALS['test_files'] as $f) {
$test_files[] = array($f, $file);
}
}
$test_cnt += count($test_files) - 1;
$test_idx--;
show_redirect_start($IN_REDIRECT['TESTS'], $tested, $tested_file);
// set up environment
$redirenv = array_merge($environment, $IN_REDIRECT['ENV']);
$redirenv['REDIR_TEST_DIR'] = realpath($IN_REDIRECT['TESTS']) . DIRECTORY_SEPARATOR;
usort($test_files, "test_sort");
run_all_tests($test_files, $redirenv, $tested);
show_redirect_ends($IN_REDIRECT['TESTS'], $tested, $tested_file);
// a redirected test never fails
$IN_REDIRECT = false;
return 'REDIR';
}
}
if (is_array($org_file) || @count($section_text['REDIRECTTEST']) == 1) {
if (is_array($org_file)) {
$file = $org_file[0];
}
$bork_info = "Redirected test did not contain redirection info";
show_result("BORK", $bork_info, '', $temp_filenames);
$PHP_FAILED_TESTS['BORKED'][] = array('name' => $file, 'test_name' => '', 'output' => '', 'diff' => '', 'info' => "{$bork_info} [{$file}]");
//$test_cnt -= 1; // Only if is_array($org_file) ?
//$test_idx--;
return 'BORKED';
}
// We've satisfied the preconditions - run the test!
if ($cfg['show']['php']) {
echo "\n========TEST========\n";
echo $section_text['FILE'];
echo "========DONE========\n";
}
save_text($test_file, $section_text['FILE'], $temp_file);
if (array_key_exists('GET', $section_text)) {
$query_string = trim($section_text['GET']);
} else {