예제 #1
0
 public function testRedirect()
 {
     $res = new \Slim\Http\Response();
     $res->redirect('/foo');
     $pStatus = new \ReflectionProperty($res, 'status');
     $pStatus->setAccessible(true);
     $this->assertEquals(302, $pStatus->getValue($res));
     $this->assertEquals('/foo', $res->headers['Location']);
 }
예제 #2
0
 /**
  * Test redirect with custom status
  */
 public function testRedirectWithCustomStatus()
 {
     $r = new \Slim\Http\Response();
     $r->redirect('/foo', 307);
     $this->assertEquals(307, $r->status());
     $this->assertEquals('/foo', $r['Location']);
 }