not->toBeFalse(); $offset = 0; while (($at = strpos($source, "posix_kill(\$p['pid'], SIGTERM)", $offset)) !== false) { $preceding = substr($source, max(0, $at - 400), min(400, $at)); // toContain() takes needles, not a message, so assert plainly and // name the file through the surrounding loop instead. expect(str_contains($preceding, 'cacti_process_still_running')) ->toBeTrue(); $offset = $at + 1; } } });