Skip to content

Commit

Permalink
The assertPermanentRedirect and assertTemporaryRedirect take a location
Browse files Browse the repository at this point in the history
parameter and asserts the redirection location is exact.
  • Loading branch information
arteymix committed Nov 25, 2014
1 parent 19020c0 commit 52e2f6e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions classes/Kohana/Unittest/TestCase/Integration.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php defined('SYSPATH') or die('No direct script access.');
<?php

defined('SYSPATH') or die('No direct script access.');

/**
* TestCase for testing in integration with Request and Response objects.
Expand Down Expand Up @@ -38,14 +40,16 @@ public function assertOk(Response $response, $message = NULL)
$this->assertStatus(200, $response, $message);
}

public function assertPermanentRedirection(Response $response, $message = NULL)
public function assertPermanentRedirection($location, Response $response, $message = NULL)
{
$this->assertStatus(301, $response, $message);
$this->assertEquals($location, $response->headers('Location'));
}

public function assertTemporaryRedirection(Response $response, $message = NULL)
public function assertTemporaryRedirection($location, Response $response, $message = NULL)
{
$this->assertStatus(302, $response, $message);
$this->assertEquals($location, $response->headers('Location'));
}

public function assertUnauthorized(Response $response, $message = NULL)
Expand Down

0 comments on commit 52e2f6e

Please sign in to comment.