RedirectResponse tests
This commit is contained in:
parent
2cf50b7801
commit
21a5841c6a
|
@ -25,6 +25,22 @@ class RedirectResponseTest extends \PHPUnit_Framework_TestCase
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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');
|
||||||
|
@ -48,6 +64,15 @@ class RedirectResponseTest extends \PHPUnit_Framework_TestCase
|
||||||
$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);
|
||||||
|
|
Reference in New Issue