Lines Matching refs:this
30 $this->config = array_shift($argv);
31 $this->message = vsprintf(
50 $this->options = $config;
68 $this->options[$key] = $value;
74 $this->options[$key][] = $value;
76 $this->options[$key] = array($config[$key], $value);
79 $this->options[$key] = $value;
88 $this->flags[] = substr($key, 1);
93 if (!is_executable($this->options['phpdbg'])) {
95 … $this->options, 'phpdbg could not be found at the specified path (%s)', $this->options['phpdbg']);
96 } else $this->options['phpdbg'] = realpath($this->options['phpdbg']);
98 $this->options['width'] = (integer) $this->options['width'];
101 if ($this->options['width'] < 50) {
102 $this->options['width'] = 50;
106 $this->options['lwidth'] = ceil($this->options['width'] / 3);
107 $this->options['rwidth'] = ceil($this->options['width'] - $this->options['lwidth']) - 5;
112 $flag, $this->flags);
115 public function offsetExists($offset) { return isset($this->options[$offset]); }
116 public function offsetGet($offset) { return $this->options[$offset]; }
117 public function offsetUnset($offset) { unset($this->options[$offset]); }
118 public function offsetSet($offset, $data) { $this->options[$offset] = $data; }
139 $this->config = $config;
141 if ($this->config->hasFlag('help') ||
142 $this->config->hasFlag('h')) {
143 $this->showUsage();
154 $where = ($in != null) ? array($in) : $this->config['path'];
163 $paths, $this->findPaths("$path/$child"));
181 '-', $this->config['width'] - strlen($path)),
190 if (!isset($this->stats[$path])) {
194 $total = array_sum($this->stats[$path]);
197 @$this->totals[true] += $this->stats[$path][true];
198 @$this->totals[false] += $this->stats[$path][false];
202 $this->stats[$path][true],
203 $this->stats[$path][false],
204 (100 / $total) * $this->stats[$path][true]);
209 ' ', $this->config['width'] - strlen($stats)),
212 printf("%s%s", str_repeat('-', $this->config['width']+3), PHP_EOL);
221 $total = array_sum($this->totals);
224 $this->totals[true],
225 $this->totals[false],
226 (100 / $total) * $this->totals[true]);
230 ' ', $this->config['width'] - strlen($stats)),
239 printf('usage: php %s [flags] [options]%s', $this->config['exec'], PHP_EOL);
251 $this->config['exec'], PHP_EOL);
270 $tests[] = new Test($this->config, $test);
282 @$this->stats[$path][($result=$test->getResult())]++;
285 "%-{$this->config['lwidth']}s %-{$this->config['rwidth']}s [%s]%s",
367 if (property_exists($this, $chunks[0])) {
373 case 'EXACT': { $this->expect = TEST::EXACT; } break;
376 case 'STRING': { $this->expect = TEST::STRING; } break;
379 case 'CISTRING': { $this->expect = TEST::CISTRING; } break;
382 case 'FORMAT': { $this->expect = TEST::FORMAT; } break;
386 $this->config, "unknown type of expectation (%s)", $chunks[1]);
392 $this->$chunks[0] = $chunks[1];
404 switch ($this->expect) {
406 $this->match[] = str_replace(
411 default: $this->match[] = $line;
423 $this->config = $config;
424 $this->file = $file;
433 $options = sprintf('-i%s -nqb', $this->file);
435 if ($this->options) {
439 $this->config['options'],
440 $this->options
444 '%s %s', $options, $this->config['options']
448 $result = `{$this->config['phpdbg']} {$options}`;
452 if (!$line && !isset($this->match[$num]))
455 switch ($this->expect) {
457 if (strcmp($line, $this->match[$num]) !== 0) {
458 $this->diff['wants'][$num] = &$this->match[$num];
459 $this->diff['gets'][$num] = $line;
464 if (strpos($line, $this->match[$num]) === false) {
465 $this->diff['wants'][$num] = &$this->match[$num];
466 $this->diff['gets'][$num] = $line;
471 if (stripos($line, $this->match[$num]) === false) {
472 $this->diff['wants'][$num] = &$this->match[$num];
473 $this->diff['gets'][$num] = $line;
479 if (!preg_match("/^{$this->match[$num]}\$/s", $line)) {
480 $this->diff['wants'][$num] = &$this->match[$num];
481 $this->diff['gets'][$num] = $line;
488 $this->writeLog($result);
489 $this->writeDiff();
491 return (count($this->diff) == 0);
499 if (count($this->diff['wants'])) {
500 if (!$this->config->hasFlag('nodiff')) {
501 if ($this->config->hasFlag('diff2stdout')) {
507 dirname($this->file), basename($this->file));
512 foreach ($this->diff['wants'] as $line => $want) {
513 $got = $this->diff['gets'][$line];
534 dirname($this->file), basename($this->file));
536 if (count($this->diff) && $result) {
537 if (!in_array('nolog', $this->config['flags'])) {