diff options
| author | Ondřej Surý <ondrej@sury.org> | 2014-06-20 12:01:47 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2014-06-20 12:01:47 +0200 |
| commit | 60d44b592c4c4fdcbbf92db2882a97a9cc54713c (patch) | |
| tree | 58f7068d9acde2338841263461fbf95d77a9ee2e /sapi/phpdbg/tests/run-tests.php | |
| parent | c63e1a09f5cbd757f59beb729fb0fb36516819a9 (diff) | |
| download | php-60d44b592c4c4fdcbbf92db2882a97a9cc54713c.tar.gz | |
New upstream version 5.6.0~rc1+dfsgupstream/5.6.0_rc1+dfsg
Diffstat (limited to 'sapi/phpdbg/tests/run-tests.php')
| -rw-r--r-- | sapi/phpdbg/tests/run-tests.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sapi/phpdbg/tests/run-tests.php b/sapi/phpdbg/tests/run-tests.php index 47a998cca..1cc31d815 100644 --- a/sapi/phpdbg/tests/run-tests.php +++ b/sapi/phpdbg/tests/run-tests.php @@ -135,8 +135,8 @@ namespace phpdbg\testing { * @param array basic configuration * @param array command line */ - public function __construct(TestsConfiguration &$config) { - $this->config = &$config; + public function __construct(TestsConfiguration $config) { + $this->config = $config; if ($this->config->hasFlag('help') || $this->config->hasFlag('h')) { @@ -153,7 +153,7 @@ namespace phpdbg\testing { $paths = array(); $where = ($in != null) ? array($in) : $this->config['path']; - foreach ($where as &$path) { + foreach ($where as $path) { if ($path) { if (is_dir($path)) { $paths[] = $path; @@ -243,6 +243,7 @@ namespace phpdbg\testing { printf("\t--options\toptions to pass to phpdbg%s", PHP_EOL); printf("\t--phpdbg\tpath to phpdbg binary%s", PHP_EOL); printf('[flags]:%s', PHP_EOL); + printf("\t-diff2stdout\t\twrite diff to stdout instead of files%s", PHP_EOL); printf("\t-nodiff\t\tdo not write diffs on failure%s", PHP_EOL); printf("\t-nolog\t\tdo not write logs on failure%s", PHP_EOL); printf('[examples]:%s', PHP_EOL); @@ -266,9 +267,11 @@ namespace phpdbg\testing { $test = sprintf('%s/%s', $path, $file); if (preg_match('~\.test$~', $test)) { - yield new Test($this->config, $test); + $tests[] = new Test($this->config, $test); } } + + return $tests; } /** @@ -354,7 +357,7 @@ namespace phpdbg\testing { * @param array configuration * @param string file */ - public function __construct(TestsConfiguration &$config, &$file) { + public function __construct(TestsConfiguration $config, $file) { if (($handle = fopen($file, 'r'))) { while (($line = fgets($handle))) { $trim = trim($line); @@ -417,8 +420,8 @@ namespace phpdbg\testing { } fclose($handle); - $this->config = &$config; - $this->file = &$file; + $this->config = $config; + $this->file = $file; } } @@ -427,8 +430,7 @@ namespace phpdbg\testing { * */ public function getResult() { - $options = sprintf( - '-i%s -nqb', $this->file); + $options = sprintf('-i%s -nqb', $this->file); if ($this->options) { $options = sprintf( @@ -526,7 +528,7 @@ namespace phpdbg\testing { * Write log to disk if configuration allows it * */ - protected function writeLog(&$result = null) { + protected function writeLog($result = null) { $log = sprintf( '%s/%s.log', dirname($this->file), basename($this->file)); |
