Skip to content

Commit

Permalink
Fix unit test for redirect function
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge authored and C-Lodder committed May 29, 2017
1 parent aacf018 commit 9b13878
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -573,38 +573,33 @@ public function testRedirectWithExistingStatusCode1()
$this->class->redirect($url, false);

// It has two statuses, but the second status will be the final status
$this->assertEquals(
array('HTTP/1.1 201', true, null),
$this->class->headers[0]
);

$this->assertEquals(
array('HTTP/1.1 303 See other', true, 303),
$this->class->headers[1]
$this->class->headers[0]
);

$this->assertEquals(
array('Location: ' . $base . $url, true, null),
$this->class->headers[2]
$this->class->headers[1]
);

$this->assertEquals(
array('Content-Type: text/html; charset=utf-8', true, null),
$this->class->headers[3]
$this->class->headers[2]
);

$this->assertRegexp('/Expires/',$this->class->headers[4][0]);
$this->assertRegexp('/Expires/',$this->class->headers[3][0]);

$this->assertRegexp('/Last-Modified/',$this->class->headers[5][0]);
$this->assertRegexp('/Last-Modified/',$this->class->headers[4][0]);

$this->assertEquals(
array('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0', true, null),
$this->class->headers[6]
$this->class->headers[5]
);

$this->assertEquals(
array('Pragma: no-cache', true, null),
$this->class->headers[7]
$this->class->headers[6]
);
}

Expand Down

0 comments on commit 9b13878

Please sign in to comment.