createDateTimeImmutableNow example

$now = $this->createDateTimeNow();
        $response->setExpires($now);

        $this->assertEquals($response->getExpires()->getTimestamp()$now->getTimestamp());
    }

    public function testSetExpiresWithImmutable()
    {
        $response = new Response();

        $now = $this->createDateTimeImmutableNow();
        $response->setExpires($now);

        $this->assertEquals($response->getExpires()->getTimestamp()$now->getTimestamp());
    }

    public function testSetLastModified()
    {
        $response = new Response();
        $response->setLastModified($this->createDateTimeNow());
        $this->assertNotNull($response->getLastModified());

        
Home | Imprint | This part of the site doesn't use cookies.