File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
src/Symfony/Component/HttpFoundation/Tests Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,22 @@ public function testGenerateMetaRedirect()
2525 ));
2626 }
2727
28+ /**
29+ * @expectedException \InvalidArgumentException
30+ */
31+ public function testRedirectResponseConstructorNullUrl ()
32+ {
33+ $ response = new RedirectResponse (null );
34+ }
35+
36+ /**
37+ * @expectedException \InvalidArgumentException
38+ */
39+ public function testRedirectResponseConstructorWrongStatusCode ()
40+ {
41+ $ response = new RedirectResponse ('foo.bar ' , 404 );
42+ }
43+
2844 public function testGenerateLocationHeader ()
2945 {
3046 $ response = new RedirectResponse ('foo.bar ' );
@@ -48,6 +64,15 @@ public function testSetTargetUrl()
4864 $ this ->assertEquals ('baz.beep ' , $ response ->getTargetUrl ());
4965 }
5066
67+ /**
68+ * @expectedException \InvalidArgumentException
69+ */
70+ public function testSetTargetUrlNull ()
71+ {
72+ $ response = new RedirectResponse ('foo.bar ' );
73+ $ response ->setTargetUrl (null );
74+ }
75+
5176 public function testCreate ()
5277 {
5378 $ response = RedirectResponse::create ('foo ' , 301 );
You can’t perform that action at this time.
0 commit comments