/** * Checks if the test is still running. * @return bool */ public function isRunning() { if (!is_resource($this->stdout)) { return FALSE; } $this->output .= stream_get_contents($this->stdout); $status = proc_get_status($this->proc); if ($status['running']) { return TRUE; } fclose($this->stdout); $code = proc_close($this->proc); $this->exitCode = $code === self::CODE_NONE ? $status['exitcode'] : $code; if ($this->php->isCgi() && count($tmp = explode("\r\n\r\n", $this->output, 2)) >= 2) { list($headers, $this->output) = $tmp; foreach (explode("\r\n", $headers) as $header) { $a = strpos($header, ':'); if ($a !== FALSE) { $this->headers[trim(substr($header, 0, $a))] = (string) trim(substr($header, $a + 1)); } } } return FALSE; }
private function initiatePhpVersion($version, PhpExecutable $php) { if (preg_match('#^(<=|<|==|=|!=|<>|>=|>)?\\s*(.+)#', $version, $matches) && version_compare($matches[2], $php->getVersion(), $matches[1] ?: '>=')) { return array(Runner::SKIPPED, "Requires PHP {$version}."); } }