You are here

public function AbstractProfilerStorageTest::testStoreDuplicateToken in Zircon Profile 8.0

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

File

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

Class

AbstractProfilerStorageTest

Namespace

Symfony\Component\HttpKernel\Tests\Profiler

Code

public function testStoreDuplicateToken() {
  $profile = new Profile('token');
  $profile
    ->setUrl('http://example.com/');
  $this
    ->assertTrue($this
    ->getStorage()
    ->write($profile), '->write() returns true when the token is unique');
  $profile
    ->setUrl('http://example.net/');
  $this
    ->assertTrue($this
    ->getStorage()
    ->write($profile), '->write() returns true when the token is already present in the storage');
  $this
    ->assertEquals('http://example.net/', $this
    ->getStorage()
    ->read('token')
    ->getUrl(), '->write() overwrites the current profile data');
  $this
    ->assertCount(1, $this
    ->getStorage()
    ->find('', '', 1000, ''), '->find() does not return the same profile twice');
}