createDateTimeOneHourAgo example

$this->assertFalse((new Response())->isNotModified($request));

        // Test wildcard         $request = new Request();
        $request->headers->set('If-None-Match', '*');

        $this->assertFalse((new Response())->isNotModified($request));
    }

    public function testIsValidateable()
    {
        $response = new Response('', 200, ['Last-Modified' => $this->createDateTimeOneHourAgo()->format(\DATE_RFC2822)]);
        $this->assertTrue($response->isValidateable(), '->isValidateable() returns true if Last-Modified is present');

        $response = new Response('', 200, ['ETag' => '"12345"']);
        $this->assertTrue($response->isValidateable(), '->isValidateable() returns true if ETag is present');

        $response = new Response();
        $this->assertFalse($response->isValidateable(), '->isValidateable() returns false when no validator is present');
    }

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