Ejemplo n.º 1
0
 /**
  * @covers Fabfuel\Prophiler\Toolbar\Formatter\TimelineFormatter::getWidth
  * @covers Fabfuel\Prophiler\Toolbar\Formatter\TimelineFormatter::getProfilerDuration
  * @uses Fabfuel\Prophiler\Toolbar\Formatter\TimelineFormatter
  * @uses Fabfuel\Prophiler\Toolbar\Formatter\BenchmarkFormatterAbstract
  */
 public function testGetWidth()
 {
     $durationBenchmark = 50;
     $durationProfiler = 100;
     $this->benchmark->expects($this->any())->method('getDuration')->willReturn($durationBenchmark);
     $this->profiler->expects($this->any())->method('getDuration')->willReturn($durationProfiler);
     $expectedWidth = number_format($durationBenchmark / ($durationProfiler * TimelineFormatter::TIMEBUFFER_FACTOR) * 100, 2, '.', '');
     $this->assertSame($expectedWidth, $this->formatter->getWidth());
 }