You are here

public function AbstractProfilerStorageTest::testDuplicates in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/Profiler/AbstractProfilerStorageTest.php \Symfony\Component\HttpKernel\Tests\Profiler\AbstractProfilerStorageTest::testDuplicates()

File

vendor/symfony/http-kernel/Tests/Profiler/AbstractProfilerStorageTest.php, line 234

Class

AbstractProfilerStorageTest

Namespace

Symfony\Component\HttpKernel\Tests\Profiler

Code

public function testDuplicates() {
  for ($i = 1; $i <= 5; ++$i) {
    $profile = new Profile('foo' . $i);
    $profile
      ->setIp('127.0.0.1');
    $profile
      ->setUrl('http://example.net/');
    $profile
      ->setMethod('GET');

    ///three duplicates
    $this
      ->getStorage()
      ->write($profile);
    $this
      ->getStorage()
      ->write($profile);
    $this
      ->getStorage()
      ->write($profile);
  }
  $this
    ->assertCount(3, $this
    ->getStorage()
    ->find('127.0.0.1', 'http://example.net/', 3, 'GET'), '->find() method returns incorrect number of entries');
}