/** * Test Expires */ public function testExpiresAsInteger() { Slim_Environment::mock(array('SCRIPT_NAME' => '/foo', 'PATH_INFO' => '/bar')); $fiveDaysFromNow = time() + 60 * 60 * 24 * 5; $expectedDate = gmdate('D, d M Y', $fiveDaysFromNow); //Just the day, month, and year $s = new Slim(); $s->get('/bar', function () use($s, $fiveDaysFromNow) { $s->expires($fiveDaysFromNow); }); $s->call(); list($status, $header, $body) = $s->response()->finalize(); $this->assertTrue(isset($header['Expires'])); $this->assertEquals(0, strpos($header['Expires'], $expectedDate)); }