public function AbstractProfilerStorageTest::testRetrieveByIp

File

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

Class

AbstractProfilerStorageTest

Namespace

Symfony\Component\HttpKernel\Tests\Profiler

Code

public function testRetrieveByIp() {
  $profile = new Profile('token');
  $profile
    ->setIp('127.0.0.1');
  $profile
    ->setMethod('GET');
  $this
    ->getStorage()
    ->write($profile);
  $this
    ->assertCount(1, $this
    ->getStorage()
    ->find('127.0.0.1', '', 10, 'GET'), '->find() retrieve a record by IP');
  $this
    ->assertCount(0, $this
    ->getStorage()
    ->find('127.0.%.1', '', 10, 'GET'), '->find() does not interpret a "%" as a wildcard in the IP');
  $this
    ->assertCount(0, $this
    ->getStorage()
    ->find('127.0._.1', '', 10, 'GET'), '->find() does not interpret a "_" as a wildcard in the IP');
}