示例#1
0
 /**
  * @covers CSanquer\FakeryGenerator\Helper\Memory::convert
  * @dataProvider providerConvert
  */
 public function testConvert($size, $decimals, $baseUnit, $expected)
 {
     $this->assertEquals($expected, Memory::convert($size, $decimals, $baseUnit));
 }
 protected function formatStopwatchEvent($eventName, StopwatchEvent $event, OutputInterface $output, $withMemoryUsage = false)
 {
     $duration = new DateIntervalExtended('PT0S', $event->getDuration());
     if ($eventName == 'total') {
         $output->write('<info>Total (Full processing)</info> : ');
     } else {
         $output->write($eventName . ' : ');
     }
     $output->writeln('<comment>' . $duration->prettyFormat() . '</comment>');
     if ($withMemoryUsage) {
         $output->writeln('Memory usage : <comment>' . Memory::convert($event->getMemory()) . '</comment>');
     }
 }