Lines Matching refs:this
47 | enabled. To enable this extension either compile your PHP |
76 | TEST_PHP_EXECUTABLE and running this script with PHP 5. |
164 return $this->response_headers['Status']=='200';
273 $this->urlparts = @parse_url($URL);
274 $this->url = $URL;
275 $this->options = $options;
276 $this->headers = $headers;
277 $this->postdata = &$postdata;
278 $this->doRequest();
283 if (!$this->_validateUrl()) return;
285 if (isset($this->options['timeout']))
286 $this->timeout = (int)$this->options['timeout'];
288 $this->_sendHTTP();
293 if ( ! is_array($this->urlparts) ) {
296 if (!isset($this->urlparts['host'])) {
297 $this->urlparts['host']='127.0.0.1';
299 if (!isset($this->urlparts['port'])) {
300 $this->urlparts['port'] = 80;
302 if (!isset($this->urlparts['path']) || !$this->urlparts['path'])
303 $this->urlparts['path'] = '/';
309 if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $this->incoming_payload, $match)) {
310 $this->response = $match[2];
312 $this->errmsg = "HTTP Response $status[1] Not Found";
316 $this->response_headers = array();
320 $this->response_headers[trim($line[0])] = trim($line[1]);
323 $this->response_headers['Status']=$status[1];
325 if(strlen($this->response) > 0) return TRUE;
327 $this->errmsg = 'Invalid HTTP Response';
333 $fullpath = $this->urlparts['path'].
334 (isset($this->urlparts['query'])?'?'.$this->urlparts['query']:'').
335 (isset($this->urlparts['fragment'])?'#'.$this->urlparts['fragment']:'');
336 if (isset($this->options['proxy_host'])) {
481 $this->iswin32 = substr(PHP_OS, 0, 3) == "WIN";
482 $this->checkRequirements();
483 $this->env = $_ENV;
484 $this->removeSensitiveEnvVars();
486 $this->initializeConfiguration();
487 $this->parseArgs();
488 $this->setTestPaths();
490 if ($this->conf['TEST_PHP_SRCDIR']) {
491 @chdir($this->conf['TEST_PHP_SRCDIR']);
493 $this->cwd = getcwd();
495 if (!$this->conf['TEST_PHP_SRCDIR'])
496 $this->conf['TEST_PHP_SRCDIR'] = $this->cwd;
497 if (!$this->conf['TEST_BASE_PATH'] && $this->conf['TEST_PHP_SRCDIR'])
498 $this->conf['TEST_BASE_PATH'] = $this->conf['TEST_PHP_SRCDIR'];
499 if ($this->iswin32) {
500 $this->conf['TEST_PHP_SRCDIR'] = str_replace('/','\\',$this->conf['TEST_PHP_SRCDIR']);
501 $this->conf['TEST_BASE_PATH'] = str_replace('/','\\',$this->conf['TEST_BASE_PATH']);
504 if (!$this->conf['TEST_WEB'] && !is_executable($this->conf['TEST_PHP_EXECUTABLE'])) {
505 $this->error("invalid PHP executable specified by TEST_PHP_EXECUTABLE = " .
506 $this->conf['TEST_PHP_EXECUTABLE']);
510 $this->getInstalledExtensions();
511 $this->getExecutableInfo();
512 $this->getExecutableIniSettings();
513 $this->test_executable_iscgi = strncmp($this->exec_info['PHP_SAPI'],'cgi',3)==0;
514 $this->calculateDocumentRoot();
521 settings2array($this->ini_overwrites,$params);
522 $this->info_params = settings2params($params);
524 $this->contextHeader();
525 if ($this->conf['TEST_CONTEXT_INFO']) return;
526 $this->loadFileList();
527 $this->moveTestFiles();
528 $this->run();
529 $this->summarizeResults();
534 $out = $this->runscript(PHP_INI_SETTINGS_SCRIPT,true);
535 $this->inisettings = unserialize($out);
540 $out = $this->runscript(PHP_INFO_SCRIPT,true);
551 $this->exec_info = $info;
557 $out = $this->runscript(PHP_EXTENSIONS_SCRIPT,true);
558 $this->exts_to_test = split(":",$out);
559 sort($this->exts_to_test);
560 $this->exts_tested = count($this->exts_to_test);
567 if ($this->conf['TEST_WEB']) {
568 $pi = '/testscript.' . $this->conf['TEST_WEB_EXT'];
569 if (!$cwd) $cwd = $this->conf['TEST_BASE_PATH'];
571 $pi = substr($cwd,strlen($this->conf['TEST_BASE_PATH'])) . $pi;
572 $url = $this->conf['TEST_WEB_BASE_URL'] . $pi;
588 …return executeCode($this->conf['TEST_PHP_EXECUTABLE'],$this->ini_overwrites, $script,$removeheader…
609 $this->writemsg("PASSED: $item ($reason)\n");
612 $this->writemsg("FAILED: $item ($reason)\n");
615 $this->writemsg("SKIPPED: $item ($reason)\n");
624 foreach ($this->xargs as $arg=>$arg_info) {
653 $this->writemsg("Invalid configuration file\n");
656 $this->conf = array_merge($this->conf,$conf);
659 $this->conf['TEST_PHP_ERROR_STYLE'] = strtoupper($value);
662 print $this->help();
665 if ($this->xargs[$opt][1] && isset($value))
666 $this->conf[$this->xargs[$opt][0]] = $value;
667 else if (!$this->xargs[$opt][1])
668 $this->conf[$this->xargs[$opt][0]] = isset($value)?$value:1;
670 … $this->error("Invalid argument setting for argument $opt, should be [{$this->xargs[$opt][1]}]\n");
679 $this->env = array_merge($this->env,$this->conf);
680 if (!$this->conf['TEST_WEB'] && !$this->conf['TEST_PHP_EXECUTABLE']) {
681 $this->writemsg($this->help());
689 $this->env['SSH_CLIENT']='deleted';
690 $this->env['SSH_AUTH_SOCK']='deleted';
691 $this->env['SSH_TTY']='deleted';
696 if (isset($this->env[$name])) {
697 $this->conf[$name] = $this->env[$name];
703 foreach ($this->xargs as $arg=>$arg_info) {
706 $this->conf[$arg_info[0]]=$arg_info[2];
708 $this->setEnvConfigVar($arg_info[0]);
716 if (@$this->conf['TEST_PATHS']) {
717 $this->test_dirs = array();
718 if ($this->iswin32) {
719 $paths = split(';',$this->conf['TEST_PATHS']);
721 $paths = split(':|;',$this->conf['TEST_PATHS']);
724 $this->test_dirs[] = realpath($path);
730 …$ta = strpos($a, "{$this->cwd}/tests")===0 ? 1 + (strpos($a, "{$this->cwd}/tests/run-test")===0 ? …
731 …$tb = strpos($b, "{$this->cwd}/tests")===0 ? 1 + (strpos($b, "{$this->cwd}/tests/run-test")===0 ? …
741 $this->writemsg(REQ_PHP_VERSION);
750 $this->writemsg(PROC_OPEN_MISSING);
754 $this->writemsg(PCRE_MISSING_ERROR);
758 $this->writemsg(SAFE_MODE_WARNING);
768 foreach ($this->exec_info as $k=>$v) {
772 foreach ($this->exts_to_test as $ext) {
776 foreach ($this->test_dirs as $test_dir) {
780 foreach ($this->conf as $k=>$v) {
785 if (!$this->conf['TEST_WEB'])
786 $exeinfo = "CWD : {$this->cwd}\n".
787 "PHP : {$this->conf['TEST_PHP_EXECUTABLE']}\n";
789 $this->writemsg("\n$this->ddash\n".
794 "$this->ddash\n");
799 foreach ($this->test_dirs as $dir) {
801 $this->findFilesInDir($dir, ($dir == 'ext'));
803 $this->test_files[] = $dir;
806 usort($this->test_files,array($this,"test_sort"));
807 $this->writemsg("found ".count($this->test_files)." files\n");
812 if (!$this->conf['TEST_BASE_PATH'] ||
813 $this->conf['TEST_BASE_PATH'] == $this->conf['TEST_PHP_SRCDIR']) return;
814 …$this->writemsg("moving files from {$this->conf['TEST_PHP_SRCDIR']} to {$this->conf['TEST_BASE_PAT…
815 $l = strlen($this->conf['TEST_PHP_SRCDIR']);
818 foreach ($this->test_files as $file) {
819 if (strpos($file,$this->conf['TEST_PHP_SRCDIR'])==0) {
820 $newlocation = $this->conf['TEST_BASE_PATH'].substr($file,$l);
833 $this->test_files = $files;
839 $o = opendir($dir) or $this->error("cannot open directory: $dir");
843 $skip_ext = ($is_ext_dir && !in_array($name, $this->exts_to_test));
845 $this->exts_skipped++;
847 $this->findFilesInDir("$dir/$name", FALSE, $ignore || $skip_ext);
859 $this->ignored_by_ext++;
862 $this->test_files[] = $testfile;
871 $this->writemsg("TIME START " . date('Y-m-d H:i:s', $this->start_time) . "\n".$this->ddash."\n");
872 if (count($this->test_to_run)) {
873 $this->writemsg("Running selected tests.\n");
875 $this->writemsg("Running all test files.\n");
881 $this->start_time = time();
882 $this->runHeader();
884 if (count($this->test_to_run)) {
886 foreach($this->test_to_run as $name=>$runnable) {
890 $this->test_results[$name] = $this->run_test($name);
894 foreach ($this->test_files as $name) {
895 $this->test_results[$name] = $this->run_test($name);
898 $this->end_time = time();
903 if (count($this->test_results) == 0) {
904 $this->writemsg("No tests were run.\n");
908 $n_total = count($this->test_results);
909 $n_total += $this->ignored_by_ext;
912 foreach ($this->test_results as $v) {
915 $sum_results['SKIPPED'] += $this->ignored_by_ext;
921 $this->writemsg("\n".$this->ddash."\n".
922 "TIME END " . date('Y-m-d H:i:s', $this->end_time) . "\n".
923 $this->ddash."\n".
925 $this->sdash."\n".
926 "Exts skipped : " . sprintf("%4d",$this->exts_skipped) . "\n".
927 "Exts tested : " . sprintf("%4d",$this->exts_tested) . "\n".
928 $this->sdash."\n".
933 $this->sdash."\n".
934 "Time taken : " . sprintf("%4d seconds", $this->end_time - $this->start_time) . "\n".
935 $this->ddash."\n");
938 if ($this->failed_tests) {
939 $failed_test_summary .= "\n".$this->ddash."\n".
940 "FAILED TEST SUMMARY\n".$this->sdash."\n";
941 foreach ($this->failed_tests as $failed_test_data) {
944 $failed_test_summary .= $this->ddash."\n";
947 if ($failed_test_summary && !$this->conf['NO_PHPTEST_SUMMARY']) {
948 $this->writemsg($failed_test_summary);
952 if ($sum_results['FAILED'] && !$this->conf['NO_INTERACTION']) {
954 …$this->writemsg("\nPlease allow this report to be send to the PHP QA\nteam. This will give us a be…
955 $this->writemsg("PHP's test cases are doing.\n");
956 $this->writemsg("(choose \"s\" to just save the results to a file)? [Yns]: ");
983 if (array_sum($this->failed_tests)) {
984 foreach ($this->failed_tests as $test_info) {
999 if (!$this->iswin32) {
1008 system($this->env['CC']." $flag >/dev/null 2>&1", $cc_status);
1010 $compiler = shell_exec($this->env['CC']." $flag 2>&1");
1028 $failed_tests_data .= shell_exec($this->conf['TEST_PHP_EXECUTABLE'].' -dhtml_errors=0 -i');
1049 if($this->conf['REPORT_EXIT_STATUS'] and $sum_results['FAILED']) {
1056 $ini_settings = $this->ini_overwrites;
1072 $ini = $this->getINISettings($section_text);
1078 if ($this->conf['TEST_WEB'] || $this->test_executable_iscgi) {
1082 $parts = parse_url($this->conf['TEST_WEB_BASE_URL']);
1084 $docroot = $this->conf['TEST_BASE_PATH'];
1086 $this->conf['TEST_DOCUMENT_ROOT']=$docroot;
1087 $this->conf['TEST_BASE_SCRIPT_NAME']=$parts['path'];
1088 …$this->conf['TEST_SERVER_URL']=substr($this->conf['TEST_WEB_BASE_URL'],0,strlen($this->conf['TEST_…
1090 $this->conf['TEST_DOCUMENT_ROOT']='';
1091 $this->conf['TEST_BASE_SCRIPT_NAME']='';
1092 $this->conf['TEST_SERVER_URL']='';
1100 $cwd = str_replace('\\','/',$this->cwd);
1102 $scriptname = substr($filename,strlen($this->conf['TEST_DOCUMENT_ROOT']));
1109 $env = $this->env;
1113 $sect = $this->evalSettings($testfile,$section_text['ENV']);
1126 $sect = $this->evalSettings($testfile,$section_text);
1149 or $this->error("Cannot open test file: $file");
1183 if ($docgi && !$this->conf['TEST_WEB'] && !$this->test_executable_iscgi) {
1184 $this->showstatus($section_text['TEST'], 'SKIPPED', 'CGI Test needs CGI Binary');
1190 if (($docgi || $this->conf['TEST_WEB']) &&
1192 $settings = $this->getINISettings($section_text);
1195 $haveval = isset($this->inisettings[$k]['local_value']);
1199 if (strpos($this->inisettings[$k]['local_value'],$this->cwd))
1202 if (($haveval && $this->inisettings[$k]['local_value'] != $v) || (!$haveval && $v)) {
1203 …$this->showstatus($section_text['TEST'], 'SKIPPED', "Test requires ini setting $k=[$v], not [".($h…
1210 …$output = trim($this->runscript($section_text['SKIPIF'],$this->test_executable_iscgi,realpath(dirn…
1212 if ($this->conf['TEST_PHP_DETAILED'] > 2)
1217 $this->showstatus($section_text['TEST'], 'SKIPPED', $reason);
1235 if ($this->conf['TEST_PHP_DETAILED'])
1236 $this->writemsg("\n=================\nTEST $file\n");
1238 $section_text = $this->getSectionText($file);
1240 if ($this->iswin32)
1241 $shortname = str_replace($this->conf['TEST_BASE_PATH'].'\\', '', $file);
1243 $shortname = str_replace($this->conf['TEST_BASE_PATH'].'/', '', $file);
1246 if ($this->conf['TEST_WEB']) {
1247 $tmp_file = ereg_replace('\.phpt$','.'.$this->conf['TEST_WEB_EXT'],$file);
1248 …$uri = $this->conf['TEST_BASE_SCRIPT_NAME'].str_replace($this->conf['TEST_BASE_PATH'], '', $tmp_fi…
1261 if (!$this->conf['TEST_WEB']) {
1263 $env = $this->getENVSettings($section_text,$tmp_file);
1264 $ini_overwrites = $this->getINIParams($section_text);
1274 $skipreason = $this->getSkipReason($file,$section_text,$do_cgi);
1286 if ($this->conf['TEST_WEB']) {
1287 $request = $this->getEvalTestSettings(@$section_text['REQUEST'],$tmp_file);
1288 $headers = $this->getEvalTestSettings(@$section_text['HEADERS'],$tmp_file);
1295 if (isset($this->conf['timeout'])) $options['timeout'] = $this->conf['timeout'];
1296 if (isset($this->conf['proxy_host'])) $options['proxy_host'] = $this->conf['proxy_host'];
1297 if (isset($this->conf['proxy_port'])) $options['proxy_port'] = $this->conf['proxy_port'];
1298 if (isset($this->conf['proxy_user'])) $options['proxy_user'] = $this->conf['proxy_user'];
1299 if (isset($this->conf['proxy_pass'])) $options['proxy_pass'] = $this->conf['proxy_pass'];
1302 $url = $this->conf['TEST_SERVER_URL'];
1315 if ($this->conf['TEST_PHP_DETAILED'])
1316 $this->writemsg("\nURL = $url\n");
1361 if ($this->conf['TEST_PHP_DETAILED'] > 1)
1362 $this->writemsg("\nCONTENT_LENGTH = " . $env['CONTENT_LENGTH'] .
1382 if ($this->conf['TEST_WEB']) {
1391 $out = execute($this->conf['TEST_PHP_EXECUTABLE'],$args,$post,$this->cwd,$env);
1393 if ($this->test_executable_iscgi
1407 if ($this->conf['TEST_PHP_DETAILED'] > 2) {
1447 if (!$failed && $this->conf['TEST_WEB'] && isset($section_text['EXPECTHEADERS'])) {
1482 $this->showstatus($tested, 'PASSED');
1487 $this->showstatus($tested, 'FAILED');
1489 $this->failed_tests[] = array(
1496 if ($this->conf['TEST_PHP_DETAILED'])
1497 $this->writemsg(generate_diff($wanted,$output)."\n");
1500 if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'E') !== FALSE) {
1506 if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'O') !== FALSE) {
1512 if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'D') !== FALSE) {
1518 if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'L') !== FALSE) {
1525 if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'C') !== FALSE) {
1526 $this->error_report($file,$logname,$tested);
1539 switch ($this->conf['TEST_PHP_ERROR_STYLE']) {
1542 $this->writemsg($testname . "(1) : $tested\n");
1543 $this->writemsg($logname . "(1) : $tested\n");
1546 $this->writemsg($testname . ":1: $tested\n");
1547 $this->writemsg($logname . ":1: $tested\n");
1554 $this->writemsg("ERROR: {$message}\n");