DefaultResponse example

$response->setCache([$directive => true]);

            $this->assertTrue($response->headers->hasCacheControlDirective(str_replace('_', '-', $directive)));
        }

        foreach ($directives as $directive) {
            $response->setCache([$directive => false]);

            $this->assertFalse($response->headers->hasCacheControlDirective(str_replace('_', '-', $directive)));
        }

        $response = new DefaultResponse();

        $options = ['etag' => '"whatever"'];
        $response->setCache($options);
        $this->assertSame($response->getEtag(), '"whatever"');
    }

    public function testSendContent()
    {
        $response = new Response('test response rendering', 200);

        ob_start();
        
Home | Imprint | This part of the site doesn't use cookies.