/** * @return CM_Provision_Script_Abstract[] */ protected function _getScriptList() { $scriptList = $this->_scriptList; $runLevelList = \Functional\invoke($scriptList, 'getRunLevel'); array_multisort($runLevelList, array_keys($scriptList), $scriptList); return $scriptList; }
/** * @runInSeparateProcess * @preserveGlobalState disabled */ public function testForkAndListenForChildren() { $process = CM_Process::getInstance(); $process->fork(function () { return 'foo'; }); $process->fork(function () { usleep(1000000); return 'bar'; }); usleep(500000); $responses = $process->listenForChildren(); $this->assertCount(1, $responses); $this->assertContainsOnlyInstancesOf('CM_Process_WorkloadResult', $responses); $this->assertSame([1 => 'foo'], \Functional\invoke($responses, 'getResult')); usleep(1000000); $responses = $process->listenForChildren(); $this->assertCount(1, $responses); $this->assertContainsOnlyInstancesOf('CM_Process_WorkloadResult', $responses); $this->assertSame([2 => 'bar'], \Functional\invoke($responses, 'getResult')); }