private function getMaxNumberOfProcess($maxNumberOfParallelProc) { if (null !== $maxNumberOfParallelProc && (int) $maxNumberOfParallelProc > 0) { return $maxNumberOfParallelProc; } $processorCounter = new ProcessorCounter(); return $processorCounter->execute(); }
/** * @test */ public function shouldCountTheNumberOfProcessorInLinux() { $processorCount = new ProcessorCounter(__DIR__ . '/Fixture/proc_cpuinfo'); $this->assertEquals(4, $processorCount->execute()); }