Skip to content

Commit

Permalink
RedirectResponse tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Piotrowski committed Sep 1, 2012
1 parent 2cf50b7 commit 21a5841
Showing 1 changed file with 25 additions and 0 deletions.
Expand Up @@ -25,6 +25,22 @@ public function testGenerateMetaRedirect()
)); ));
} }


/**
* @expectedException \InvalidArgumentException
*/
public function testRedirectResponseConstructorNullUrl()
{
$response = new RedirectResponse(null);
}

/**
* @expectedException \InvalidArgumentException
*/
public function testRedirectResponseConstructorWrongStatusCode()
{
$response = new RedirectResponse('foo.bar', 404);
}

public function testGenerateLocationHeader() public function testGenerateLocationHeader()
{ {
$response = new RedirectResponse('foo.bar'); $response = new RedirectResponse('foo.bar');
Expand All @@ -48,6 +64,15 @@ public function testSetTargetUrl()
$this->assertEquals('baz.beep', $response->getTargetUrl()); $this->assertEquals('baz.beep', $response->getTargetUrl());
} }


/**
* @expectedException \InvalidArgumentException
*/
public function testSetTargetUrlNull()
{
$response = new RedirectResponse('foo.bar');
$response->setTargetUrl(null);
}

public function testCreate() public function testCreate()
{ {
$response = RedirectResponse::create('foo', 301); $response = RedirectResponse::create('foo', 301);
Expand Down

0 comments on commit 21a5841

Please sign in to comment.