コード例 #1
0
 public function testIsVersionAllowed()
 {
     $map = [['value' => 10, 'expected' => '10.000 s'], ['value' => 60, 'expected' => '1.000 m'], ['value' => 60 * 60, 'expected' => '1.000 h']];
     foreach ($map as $test) {
         $this->assertSame($test['expected'], TimeTakenHelper::convert($test['value']));
     }
 }
コード例 #2
0
 /**
  * Gets the content for the result line
  *
  * @param JobStats $jobStats
  * @return string
  * @author Daniel Wendlandt
  */
 private function getResultLineForOutput(JobStats $jobStats)
 {
     $line = '<info>Finished in <comment>%s</comment>' . ' - MemoryUsed: <comment>%s</comment>' . ' - MemoryUsage: <comment>%s</comment>' . ' - MemoryUsageReal: <comment>%s</comment></info>';
     return sprintf($line, TimeTakenHelper::convert($jobStats->getTimeTaken()), DataSizeHelper::convert($jobStats->getMemoryUsed()), DataSizeHelper::convert($jobStats->getMemoryUsage()), DataSizeHelper::convert($jobStats->getMemoryUsageReal()));
 }