@@ -9,6 +9,12 @@ class LogTool
99 const P_PREFIX_STDOUT = '\[pool unconfined\] child \d+ said into stdout: ' ;
1010 const FINAL_SUFFIX = ', pipe is closed ' ;
1111
12+ const DEBUG = 'DEBUG ' ;
13+ const NOTICE = 'NOTICE ' ;
14+ const WARNING = 'WARNING ' ;
15+ const ERROR = 'ERROR ' ;
16+ const ALERT = 'ALERT ' ;
17+
1218 /**
1319 * @var string
1420 */
@@ -278,6 +284,28 @@ class LogTool
278284 return true ;
279285 }
280286
287+ /**
288+ * @param array $lines
289+ * @return bool
290+ */
291+ public function expectReloadingLines (array $ lines )
292+ {
293+ if (
294+ !$ this ->expectNotice ($ lines [0 ], 'Reloading in progress ... ' ) ||
295+ !$ this ->expectNotice ($ lines [1 ], 'reloading: .* ' )
296+ ) {
297+ return false ;
298+ }
299+
300+ for ($ i = 2 ; $ i < count ($ lines ) - 2 ; $ i ++) {
301+ if (!$ this ->expectNotice ($ lines [$ i ], 'using inherited socket fd=\d+, "[^"]+" ' )) {
302+ return false ;
303+ }
304+ }
305+
306+ return $ this ->expectStartingLines (array_splice ($ lines , $ i ));
307+ }
308+
281309 /**
282310 * @param array $lines
283311 * @return bool
@@ -359,7 +387,7 @@ class LogTool
359387 */
360388 public function expectDebug (string $ line , string $ expectedMessage , $ pool = null )
361389 {
362- return $ this ->expectEntry (' DEBUG ' , $ line , $ expectedMessage , $ pool );
390+ return $ this ->expectEntry (self :: DEBUG , $ line , $ expectedMessage , $ pool );
363391 }
364392
365393 /**
@@ -370,7 +398,7 @@ class LogTool
370398 */
371399 public function expectNotice (string $ line , string $ expectedMessage , $ pool = null )
372400 {
373- return $ this ->expectEntry (' NOTICE ' , $ line , $ expectedMessage , $ pool );
401+ return $ this ->expectEntry (self :: NOTICE , $ line , $ expectedMessage , $ pool );
374402 }
375403
376404 /**
@@ -381,7 +409,7 @@ class LogTool
381409 */
382410 public function expectWarning (string $ line , string $ expectedMessage , $ pool = null )
383411 {
384- return $ this ->expectEntry (' WARNING ' , $ line , $ expectedMessage , $ pool );
412+ return $ this ->expectEntry (self :: WARNING , $ line , $ expectedMessage , $ pool );
385413 }
386414
387415 /**
@@ -392,7 +420,7 @@ class LogTool
392420 */
393421 public function expectError (string $ line , string $ expectedMessage , $ pool = null )
394422 {
395- return $ this ->expectEntry (' ERROR ' , $ line , $ expectedMessage , $ pool );
423+ return $ this ->expectEntry (self :: ERROR , $ line , $ expectedMessage , $ pool );
396424 }
397425
398426 /**
@@ -403,10 +431,9 @@ class LogTool
403431 */
404432 public function expectAlert (string $ line , string $ expectedMessage , $ pool = null )
405433 {
406- return $ this ->expectEntry (' ALERT ' , $ line , $ expectedMessage , $ pool );
434+ return $ this ->expectEntry (self :: ALERT , $ line , $ expectedMessage , $ pool );
407435 }
408436
409-
410437 /**
411438 * @param string $msg
412439 * @return bool
0 commit comments