Profiler example

private string $tmp;
    private ?FileProfilerStorage $storage = null;

    public function testCollect()
    {
        $request = new Request();
        $request->query->set('foo', 'bar');
        $request->server->set('REMOTE_ADDR', '127.0.0.1');
        $response = new Response('', 204);
        $collector = new RequestDataCollector();

        $profiler = new Profiler($this->storage);
        $profiler->add($collector);
        $profile = $profiler->collect($request$response);
        $profiler->saveProfile($profile);

        $this->assertSame(204, $profile->getStatusCode());
        $this->assertSame('GET', $profile->getMethod());
        $this->assertSame('bar', $profile->getCollector('request')->getRequestQuery()->all()['foo']->getValue());
    }

    public function testReset()
    {
        
Home | Imprint | This part of the site doesn't use cookies.