diff options
Diffstat (limited to 'sapi/fpm/tests/logtool.inc')
-rw-r--r-- | sapi/fpm/tests/logtool.inc | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/sapi/fpm/tests/logtool.inc b/sapi/fpm/tests/logtool.inc index 78523635d0..caf88ce662 100644 --- a/sapi/fpm/tests/logtool.inc +++ b/sapi/fpm/tests/logtool.inc @@ -9,6 +9,12 @@ class LogTool const P_PREFIX_STDOUT = '\[pool unconfined\] child \d+ said into stdout: '; const FINAL_SUFFIX = ', pipe is closed'; + const DEBUG = 'DEBUG'; + const NOTICE = 'NOTICE'; + const WARNING = 'WARNING'; + const ERROR = 'ERROR'; + const ALERT = 'ALERT'; + /** * @var string */ @@ -282,6 +288,28 @@ class LogTool * @param array $lines * @return bool */ + public function expectReloadingLines(array $lines) + { + if ( + !$this->expectNotice($lines[0], 'Reloading in progress ...') || + !$this->expectNotice($lines[1], 'reloading: .*') + ) { + return false; + } + + for ($i = 2; $i < count($lines) - 2; $i++) { + if (!$this->expectNotice($lines[$i], 'using inherited socket fd=\d+, "[^"]+"')) { + return false; + } + } + + return $this->expectStartingLines(array_splice($lines, $i)); + } + + /** + * @param array $lines + * @return bool + */ public function expectStartingLines(array $lines) { if ($this->getError()) { @@ -359,7 +387,7 @@ class LogTool */ public function expectDebug(string $line, string $expectedMessage, $pool = null) { - return $this->expectEntry('DEBUG', $line, $expectedMessage, $pool); + return $this->expectEntry(self::DEBUG, $line, $expectedMessage, $pool); } /** @@ -370,7 +398,7 @@ class LogTool */ public function expectNotice(string $line, string $expectedMessage, $pool = null) { - return $this->expectEntry('NOTICE', $line, $expectedMessage, $pool); + return $this->expectEntry(self::NOTICE, $line, $expectedMessage, $pool); } /** @@ -381,7 +409,7 @@ class LogTool */ public function expectWarning(string $line, string $expectedMessage, $pool = null) { - return $this->expectEntry('WARNING', $line, $expectedMessage, $pool); + return $this->expectEntry(self::WARNING, $line, $expectedMessage, $pool); } /** @@ -392,7 +420,7 @@ class LogTool */ public function expectError(string $line, string $expectedMessage, $pool = null) { - return $this->expectEntry('ERROR', $line, $expectedMessage, $pool); + return $this->expectEntry(self::ERROR, $line, $expectedMessage, $pool); } /** @@ -403,10 +431,9 @@ class LogTool */ public function expectAlert(string $line, string $expectedMessage, $pool = null) { - return $this->expectEntry('ALERT', $line, $expectedMessage, $pool); + return $this->expectEntry(self::ALERT, $line, $expectedMessage, $pool); } - /** * @param string $msg * @return bool |