You are here

public function AbstractProfilerStorageTest::testRetrieveByIp 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::testRetrieveByIp()

File

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

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