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'])) {
480 $this->iswin32 = substr(PHP_OS, 0, 3) == "WIN";
481 $this->checkRequirements();
482 $this->env = $_ENV;
483 $this->removeSensitiveEnvVars();
485 $this->initializeConfiguration();
486 $this->parseArgs();
487 $this->setTestPaths();
489 if ($this->conf['TEST_PHP_SRCDIR']) {
490 @chdir($this->conf['TEST_PHP_SRCDIR']);
492 $this->cwd = getcwd();
494 if (!$this->conf['TEST_PHP_SRCDIR'])
495 $this->conf['TEST_PHP_SRCDIR'] = $this->cwd;
496 if (!$this->conf['TEST_BASE_PATH'] && $this->conf['TEST_PHP_SRCDIR'])
497 $this->conf['TEST_BASE_PATH'] = $this->conf['TEST_PHP_SRCDIR'];
498 if ($this->iswin32) {
499 $this->conf['TEST_PHP_SRCDIR'] = str_replace('/','\\',$this->conf['TEST_PHP_SRCDIR']);
500 $this->conf['TEST_BASE_PATH'] = str_replace('/','\\',$this->conf['TEST_BASE_PATH']);
503 if (!$this->conf['TEST_WEB'] && !is_executable($this->conf['TEST_PHP_EXECUTABLE'])) {
504 $this->error("invalid PHP executable specified by TEST_PHP_EXECUTABLE = " .
505 $this->conf['TEST_PHP_EXECUTABLE']);
509 $this->getInstalledExtensions();
510 $this->getExecutableInfo();
511 $this->getExecutableIniSettings();
512 $this->test_executable_iscgi = strncmp($this->exec_info['PHP_SAPI'],'cgi',3)==0;
513 $this->calculateDocumentRoot();
520 settings2array($this->ini_overwrites,$params);
521 $this->info_params = settings2params($params);
523 $this->contextHeader();
524 if ($this->conf['TEST_CONTEXT_INFO']) return;
525 $this->loadFileList();
526 $this->moveTestFiles();
527 $this->run();
528 $this->summarizeResults();
533 $out = $this->runscript(PHP_INI_SETTINGS_SCRIPT,true);
534 $this->inisettings = unserialize($out);
539 $out = $this->runscript(PHP_INFO_SCRIPT,true);
550 $this->exec_info = $info;
556 $out = $this->runscript(PHP_EXTENSIONS_SCRIPT,true);
557 $this->exts_to_test = explode(":",$out);
558 sort($this->exts_to_test);
559 $this->exts_tested = count($this->exts_to_test);
566 if ($this->conf['TEST_WEB']) {
567 $pi = '/testscript.' . $this->conf['TEST_WEB_EXT'];
568 if (!$cwd) $cwd = $this->conf['TEST_BASE_PATH'];
570 $pi = substr($cwd,strlen($this->conf['TEST_BASE_PATH'])) . $pi;
571 $url = $this->conf['TEST_WEB_BASE_URL'] . $pi;
587 …return executeCode($this->conf['TEST_PHP_EXECUTABLE'],$this->ini_overwrites, $script,$removeheader…
608 $this->writemsg("PASSED: $item ($reason)\n");
611 $this->writemsg("FAILED: $item ($reason)\n");
614 $this->writemsg("SKIPPED: $item ($reason)\n");
623 foreach ($this->xargs as $arg=>$arg_info) {
652 $this->writemsg("Invalid configuration file\n");
655 $this->conf = array_merge($this->conf,$conf);
658 $this->conf['TEST_PHP_ERROR_STYLE'] = strtoupper($value);
661 print $this->help();
664 if ($this->xargs[$opt][1] && isset($value))
665 $this->conf[$this->xargs[$opt][0]] = $value;
666 else if (!$this->xargs[$opt][1])
667 $this->conf[$this->xargs[$opt][0]] = isset($value)?$value:1;
669 … $this->error("Invalid argument setting for argument $opt, should be [{$this->xargs[$opt][1]}]\n");
678 $this->env = array_merge($this->env,$this->conf);
679 if (!$this->conf['TEST_WEB'] && !$this->conf['TEST_PHP_EXECUTABLE']) {
680 $this->writemsg($this->help());
688 $this->env['SSH_CLIENT']='deleted';
689 $this->env['SSH_AUTH_SOCK']='deleted';
690 $this->env['SSH_TTY']='deleted';
695 if (isset($this->env[$name])) {
696 $this->conf[$name] = $this->env[$name];
702 foreach ($this->xargs as $arg=>$arg_info) {
705 $this->conf[$arg_info[0]]=$arg_info[2];
707 $this->setEnvConfigVar($arg_info[0]);
715 if (@$this->conf['TEST_PATHS']) {
716 $this->test_dirs = array();
717 if ($this->iswin32) {
718 $paths = explode(';',$this->conf['TEST_PATHS']);
720 $paths = explode(':|;',$this->conf['TEST_PATHS']);
723 $this->test_dirs[] = realpath($path);
729 …$ta = strpos($a, "{$this->cwd}/tests")===0 ? 1 + (strpos($a, "{$this->cwd}/tests/run-test")===0 ? …
730 …$tb = strpos($b, "{$this->cwd}/tests")===0 ? 1 + (strpos($b, "{$this->cwd}/tests/run-test")===0 ? …
740 $this->writemsg(REQ_PHP_VERSION);
749 $this->writemsg(PROC_OPEN_MISSING);
753 $this->writemsg(PCRE_MISSING_ERROR);
757 $this->writemsg(SAFE_MODE_WARNING);
767 foreach ($this->exec_info as $k=>$v) {
771 foreach ($this->exts_to_test as $ext) {
775 foreach ($this->test_dirs as $test_dir) {
779 foreach ($this->conf as $k=>$v) {
784 if (!$this->conf['TEST_WEB'])
785 $exeinfo = "CWD : {$this->cwd}\n".
786 "PHP : {$this->conf['TEST_PHP_EXECUTABLE']}\n";
788 $this->writemsg("\n$this->ddash\n".
793 "$this->ddash\n");
798 foreach ($this->test_dirs as $dir) {
800 $this->findFilesInDir($dir, ($dir == 'ext'));
802 $this->test_files[] = $dir;
805 usort($this->test_files,array($this,"test_sort"));
806 $this->writemsg("found ".count($this->test_files)." files\n");
811 if (!$this->conf['TEST_BASE_PATH'] ||
812 $this->conf['TEST_BASE_PATH'] == $this->conf['TEST_PHP_SRCDIR']) return;
813 …$this->writemsg("moving files from {$this->conf['TEST_PHP_SRCDIR']} to {$this->conf['TEST_BASE_PAT…
814 $l = strlen($this->conf['TEST_PHP_SRCDIR']);
817 foreach ($this->test_files as $file) {
818 if (strpos($file,$this->conf['TEST_PHP_SRCDIR'])==0) {
819 $newlocation = $this->conf['TEST_BASE_PATH'].substr($file,$l);
832 $this->test_files = $files;
838 $o = opendir($dir) or $this->error("cannot open directory: $dir");
842 $skip_ext = ($is_ext_dir && !in_array($name, $this->exts_to_test));
844 $this->exts_skipped++;
846 $this->findFilesInDir("$dir/$name", FALSE, $ignore || $skip_ext);
858 $this->ignored_by_ext++;
861 $this->test_files[] = $testfile;
870 $this->writemsg("TIME START " . date('Y-m-d H:i:s', $this->start_time) . "\n".$this->ddash."\n");
871 if (count($this->test_to_run)) {
872 $this->writemsg("Running selected tests.\n");
874 $this->writemsg("Running all test files.\n");
880 $this->start_time = time();
881 $this->runHeader();
883 if (count($this->test_to_run)) {
885 foreach($this->test_to_run as $name=>$runnable) {
889 $this->test_results[$name] = $this->run_test($name);
893 foreach ($this->test_files as $name) {
894 $this->test_results[$name] = $this->run_test($name);
897 $this->end_time = time();
902 if (count($this->test_results) == 0) {
903 $this->writemsg("No tests were run.\n");
907 $n_total = count($this->test_results);
908 $n_total += $this->ignored_by_ext;
911 foreach ($this->test_results as $v) {
914 $sum_results['SKIPPED'] += $this->ignored_by_ext;
920 $this->writemsg("\n".$this->ddash."\n".
921 "TIME END " . date('Y-m-d H:i:s', $this->end_time) . "\n".
922 $this->ddash."\n".
924 $this->sdash."\n".
925 "Exts skipped : " . sprintf("%4d",$this->exts_skipped) . "\n".
926 "Exts tested : " . sprintf("%4d",$this->exts_tested) . "\n".
927 $this->sdash."\n".
932 $this->sdash."\n".
933 "Time taken : " . sprintf("%4d seconds", $this->end_time - $this->start_time) . "\n".
934 $this->ddash."\n");
937 if ($this->failed_tests) {
938 $failed_test_summary .= "\n".$this->ddash."\n".
939 "FAILED TEST SUMMARY\n".$this->sdash."\n";
940 foreach ($this->failed_tests as $failed_test_data) {
943 $failed_test_summary .= $this->ddash."\n";
946 if ($failed_test_summary && !$this->conf['NO_PHPTEST_SUMMARY']) {
947 $this->writemsg($failed_test_summary);
951 if ($sum_results['FAILED'] && !$this->conf['NO_INTERACTION']) {
953 …$this->writemsg("\nPlease allow this report to be send to the PHP QA\nteam. This will give us a be…
954 $this->writemsg("PHP's test cases are doing.\n");
955 $this->writemsg("(choose \"s\" to just save the results to a file)? [Yns]: ");
982 if (array_sum($this->failed_tests)) {
983 foreach ($this->failed_tests as $test_info) {
998 if (!$this->iswin32) {
1007 system($this->env['CC']." $flag >/dev/null 2>&1", $cc_status);
1009 $compiler = shell_exec($this->env['CC']." $flag 2>&1");
1027 $failed_tests_data .= shell_exec($this->conf['TEST_PHP_EXECUTABLE'].' -dhtml_errors=0 -i');
1048 if($this->conf['REPORT_EXIT_STATUS'] and $sum_results['FAILED']) {
1055 $ini_settings = $this->ini_overwrites;
1071 $ini = $this->getINISettings($section_text);
1077 if ($this->conf['TEST_WEB'] || $this->test_executable_iscgi) {
1081 $parts = parse_url($this->conf['TEST_WEB_BASE_URL']);
1083 $docroot = $this->conf['TEST_BASE_PATH'];
1085 $this->conf['TEST_DOCUMENT_ROOT']=$docroot;
1086 $this->conf['TEST_BASE_SCRIPT_NAME']=$parts['path'];
1087 …$this->conf['TEST_SERVER_URL']=substr($this->conf['TEST_WEB_BASE_URL'],0,strlen($this->conf['TEST_…
1089 $this->conf['TEST_DOCUMENT_ROOT']='';
1090 $this->conf['TEST_BASE_SCRIPT_NAME']='';
1091 $this->conf['TEST_SERVER_URL']='';
1099 $cwd = str_replace('\\','/',$this->cwd);
1101 $scriptname = substr($filename,strlen($this->conf['TEST_DOCUMENT_ROOT']));
1108 $env = $this->env;
1112 $sect = $this->evalSettings($testfile,$section_text['ENV']);
1125 $sect = $this->evalSettings($testfile,$section_text);
1148 or $this->error("Cannot open test file: $file");
1182 if ($docgi && !$this->conf['TEST_WEB'] && !$this->test_executable_iscgi) {
1183 $this->showstatus($section_text['TEST'], 'SKIPPED', 'CGI Test needs CGI Binary');
1189 if (($docgi || $this->conf['TEST_WEB']) &&
1191 $settings = $this->getINISettings($section_text);
1194 $haveval = isset($this->inisettings[$k]['local_value']);
1198 if (strpos($this->inisettings[$k]['local_value'],$this->cwd))
1201 if (($haveval && $this->inisettings[$k]['local_value'] != $v) || (!$haveval && $v)) {
1202 …$this->showstatus($section_text['TEST'], 'SKIPPED', "Test requires ini setting $k=[$v], not [".($h…
1209 …$output = trim($this->runscript($section_text['SKIPIF'],$this->test_executable_iscgi,realpath(dirn…
1211 if ($this->conf['TEST_PHP_DETAILED'] > 2)
1216 $this->showstatus($section_text['TEST'], 'SKIPPED', $reason);
1234 if ($this->conf['TEST_PHP_DETAILED'])
1235 $this->writemsg("\n=================\nTEST $file\n");
1237 $section_text = $this->getSectionText($file);
1239 if ($this->iswin32)
1240 $shortname = str_replace($this->conf['TEST_BASE_PATH'].'\\', '', $file);
1242 $shortname = str_replace($this->conf['TEST_BASE_PATH'].'/', '', $file);
1245 if ($this->conf['TEST_WEB']) {
1246 $tmp_file = preg_replace('/\.phpt$/','.'.$this->conf['TEST_WEB_EXT'],$file);
1247 …$uri = $this->conf['TEST_BASE_SCRIPT_NAME'].str_replace($this->conf['TEST_BASE_PATH'], '', $tmp_fi…
1260 if (!$this->conf['TEST_WEB']) {
1262 $env = $this->getENVSettings($section_text,$tmp_file);
1263 $ini_overwrites = $this->getINIParams($section_text);
1273 $skipreason = $this->getSkipReason($file,$section_text,$do_cgi);
1285 if ($this->conf['TEST_WEB']) {
1286 $request = $this->getEvalTestSettings(@$section_text['REQUEST'],$tmp_file);
1287 $headers = $this->getEvalTestSettings(@$section_text['HEADERS'],$tmp_file);
1294 if (isset($this->conf['timeout'])) $options['timeout'] = $this->conf['timeout'];
1295 if (isset($this->conf['proxy_host'])) $options['proxy_host'] = $this->conf['proxy_host'];
1296 if (isset($this->conf['proxy_port'])) $options['proxy_port'] = $this->conf['proxy_port'];
1297 if (isset($this->conf['proxy_user'])) $options['proxy_user'] = $this->conf['proxy_user'];
1298 if (isset($this->conf['proxy_pass'])) $options['proxy_pass'] = $this->conf['proxy_pass'];
1301 $url = $this->conf['TEST_SERVER_URL'];
1314 if ($this->conf['TEST_PHP_DETAILED'])
1315 $this->writemsg("\nURL = $url\n");
1360 if ($this->conf['TEST_PHP_DETAILED'] > 1)
1361 $this->writemsg("\nCONTENT_LENGTH = " . $env['CONTENT_LENGTH'] .
1381 if ($this->conf['TEST_WEB']) {
1390 $out = execute($this->conf['TEST_PHP_EXECUTABLE'],$args,$post,$this->cwd,$env);
1392 if ($this->test_executable_iscgi
1406 if ($this->conf['TEST_PHP_DETAILED'] > 2) {
1499 if (!$failed && $this->conf['TEST_WEB'] && isset($section_text['EXPECTHEADERS'])) {
1534 $this->showstatus($tested, 'PASSED');
1539 $this->showstatus($tested, 'FAILED');
1541 $this->failed_tests[] = array(
1548 if ($this->conf['TEST_PHP_DETAILED'])
1549 $this->writemsg(generate_diff($wanted,$output)."\n");
1552 if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'E') !== FALSE) {
1558 if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'O') !== FALSE) {
1564 if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'D') !== FALSE) {
1570 if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'L') !== FALSE) {
1577 if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'C') !== FALSE) {
1578 $this->error_report($file,$logname,$tested);
1591 switch ($this->conf['TEST_PHP_ERROR_STYLE']) {
1594 $this->writemsg($testname . "(1) : $tested\n");
1595 $this->writemsg($logname . "(1) : $tested\n");
1598 $this->writemsg($testname . ":1: $tested\n");
1599 $this->writemsg($logname . ":1: $tested\n");
1606 $this->writemsg("ERROR: {$message}\n");