public function testHaltDir($createFile, $jobRuns)
{
$dir = __DIR__ . '/_files';
$file = $dir . '/' . static::JOB_NAME;
$fs = new Filesystem();
if ($createFile) {
$fs->touch($file);
}
$this->runJob(['haltDir' => $dir, 'closure' => function () {
echo 'test';
return true;
}]);
if ($createFile) {
$fs->remove($file);
}
$content = $this->getLogContent();
$this->assertEquals($jobRuns, is_string($content) && !empty($content));
}