public function AbstractProfilerStorageTest::testStoreDuplicateToken

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/AbstractProfilerStorageTest.php, line 83

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');
}