Exemplo n.º 1
0
 /**
  * Test Last Modified header format
  */
 public function testLastModifiedHeaderFormat()
 {
     \Slim\Environment::mock(array('SCRIPT_NAME' => '/foo', 'PATH_INFO' => '/bar'));
     $s = new \Slim\Slim();
     $s->get('/bar', function () use($s) {
         $s->lastModified(1286139652);
     });
     $s->call();
     list($status, $header, $body) = $s->response()->finalize();
     $this->assertTrue(isset($header['Last-Modified']));
     $this->assertEquals('Sun, 03 Oct 2010 21:00:52 GMT', $header['Last-Modified']);
 }
Exemplo n.º 2
0
 public function testLastModifiedOnlyAcceptsIntegers()
 {
     $this->setExpectedException('\\InvalidArgumentException');
     \Slim\Environment::mock(array('SCRIPT_NAME' => '/foo', 'PATH_INFO' => '/bar'));
     $s = new \Slim\Slim();
     $s->get('/bar', function () use($s) {
         $s->lastModified('Test');
     });
     $s->call();
 }