Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

RedirectResponse tests

  • Loading branch information...
commit 21a5841c6a46f281ebe505898d26b5a96ba9d9e6 1 parent 2cf50b7
@eventhorizonpl eventhorizonpl authored
View
25 src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php
@@ -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()
{
$response = new RedirectResponse('foo.bar');
@@ -48,6 +64,15 @@ public function testSetTargetUrl()
$this->assertEquals('baz.beep', $response->getTargetUrl());
}
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testSetTargetUrlNull()
+ {
+ $response = new RedirectResponse('foo.bar');
+ $response->setTargetUrl(null);
+ }
+
public function testCreate()
{
$response = RedirectResponse::create('foo', 301);
Please sign in to comment.
Something went wrong with that request. Please try again.