You are here

public function ProfilerTest::testCollect in Zircon Profile 8

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

File

vendor/symfony/http-kernel/Tests/Profiler/ProfilerTest.php, line 25

Class

ProfilerTest

Namespace

Symfony\Component\HttpKernel\Tests\Profiler

Code

public function testCollect() {
  $request = new Request();
  $request->query
    ->set('foo', 'bar');
  $response = new Response('', 204);
  $collector = new RequestDataCollector();
  $profiler = new Profiler($this->storage);
  $profiler
    ->add($collector);
  $profile = $profiler
    ->collect($request, $response);
  $this
    ->assertSame(204, $profile
    ->getStatusCode());
  $this
    ->assertSame('GET', $profile
    ->getMethod());
  $this
    ->assertEquals(array(
    'foo' => 'bar',
  ), $profiler
    ->get('request')
    ->getRequestQuery()
    ->all());
}