public function StopwatchEventTest::testGetPeriods

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/StopwatchEventTest.php, line 38

Class

StopwatchEventTest
StopwatchEventTest

Namespace

Symfony\Component\HttpKernel\Tests\Debug

Code

public function testGetPeriods() {
  $event = new StopwatchEvent(microtime(true) * 1000);
  $this
    ->assertEquals(array(), $event
    ->getPeriods());
  $event = new StopwatchEvent(microtime(true) * 1000);
  $event
    ->start();
  $event
    ->stop();
  $this
    ->assertCount(1, $event
    ->getPeriods());
  $event = new StopwatchEvent(microtime(true) * 1000);
  $event
    ->start();
  $event
    ->stop();
  $event
    ->start();
  $event
    ->stop();
  $this
    ->assertCount(2, $event
    ->getPeriods());
}