protected function _doTestStartAll($baseConfig, $useFactoryMethodToCreateKeeper = false)
{
$config = $baseConfig;
$config['quantity'] = $quantity = 3;
if (!$useFactoryMethodToCreateKeeper) {
$keeper = new OneForOneKeeper(array(new Config($config)));
} else {
$keeper = \Comos\Qpm\Supervision\Supervisor::oneForOne($config)->getKeeper();
}
$keeper->startAll();
$pids = array();
for ($i = 0; $i < $quantity; $i++) {
$status = 0;
$pids[\pcntl_wait($status)] = true;
}
$currentPid = \posix_getpid();
$r = \file_get_contents($this->_logFile);
$lines = explode("\n", $r);
$count = 0;
foreach ($lines as $line) {
if (trim($line)) {
list($pid, $ppid) = explode(',', $line);
$count++;
$this->assertTrue($pids[$pid]);
$this->assertEquals($currentPid, $ppid);
}
}
$this->assertEquals($quantity, $count);
}