@@ -48,11 +48,12 @@ public function testGetRequest()
4848
4949 public function testGetRequestNull ()
5050 {
51+ $ client = $ this ->getBrowser ();
52+
5153 $ this ->expectException (BadMethodCallException::class);
5254 $ this ->expectExceptionMessage ('The "request()" method must be called before "Symfony \\Component \\BrowserKit \\AbstractBrowser::getRequest()". ' );
5355
54- $ client = $ this ->getBrowser ();
55- $ this ->assertNull ($ client ->getRequest ());
56+ $ client ->getRequest ();
5657 }
5758
5859 public function testXmlHttpRequest ()
@@ -96,20 +97,22 @@ public function testGetResponse()
9697
9798 public function testGetResponseNull ()
9899 {
100+ $ client = $ this ->getBrowser ();
101+
99102 $ this ->expectException (BadMethodCallException::class);
100103 $ this ->expectExceptionMessage ('The "request()" method must be called before "Symfony \\Component \\BrowserKit \\AbstractBrowser::getResponse()". ' );
101104
102- $ client = $ this ->getBrowser ();
103- $ this ->assertNull ($ client ->getResponse ());
105+ $ client ->getResponse ();
104106 }
105107
106108 public function testGetInternalResponseNull ()
107109 {
110+ $ client = $ this ->getBrowser ();
111+
108112 $ this ->expectException (BadMethodCallException::class);
109113 $ this ->expectExceptionMessage ('The "request()" method must be called before "Symfony \\Component \\BrowserKit \\AbstractBrowser::getInternalResponse()". ' );
110114
111- $ client = $ this ->getBrowser ();
112- $ this ->assertNull ($ client ->getInternalResponse ());
115+ $ client ->getInternalResponse ();
113116 }
114117
115118 public function testGetContent ()
@@ -132,11 +135,12 @@ public function testGetCrawler()
132135
133136 public function testGetCrawlerNull ()
134137 {
138+ $ client = $ this ->getBrowser ();
139+
135140 $ this ->expectException (BadMethodCallException::class);
136141 $ this ->expectExceptionMessage ('The "request()" method must be called before "Symfony \\Component \\BrowserKit \\AbstractBrowser::getCrawler()". ' );
137142
138- $ client = $ this ->getBrowser ();
139- $ this ->assertNull ($ client ->getCrawler ());
143+ $ client ->getCrawler ();
140144 }
141145
142146 public function testRequestHttpHeaders ()
@@ -380,7 +384,7 @@ public function testSubmitPreserveAuth()
380384 $ this ->assertSame ('bar ' , $ server ['PHP_AUTH_PW ' ]);
381385 }
382386
383- public function testSubmitPassthrewHeaders ()
387+ public function testSubmitPassthroughHeaders ()
384388 {
385389 $ client = $ this ->getBrowser ();
386390 $ client ->setNextResponse (new Response ('<html><form action="/foo"><input type="submit" /></form></html> ' ));
@@ -619,7 +623,7 @@ public function testFollowMetaRefresh(string $content, string $expectedEndingUrl
619623 $ this ->assertSame ($ expectedEndingUrl , $ client ->getRequest ()->getUri ());
620624 }
621625
622- public static function getTestsForMetaRefresh ()
626+ public static function getTestsForMetaRefresh (): array
623627 {
624628 return [
625629 ['<html><head><meta http-equiv="Refresh" content="4" /><meta http-equiv="refresh" content="0; URL=http://www.example.com/redirected"/></head></html> ' , 'http://www.example.com/redirected ' ],
@@ -840,10 +844,11 @@ public function testInternalRequest()
840844
841845 public function testInternalRequestNull ()
842846 {
847+ $ client = $ this ->getBrowser ();
848+
843849 $ this ->expectException (BadMethodCallException::class);
844850 $ this ->expectExceptionMessage ('The "request()" method must be called before "Symfony \\Component \\BrowserKit \\AbstractBrowser::getInternalRequest()". ' );
845851
846- $ client = $ this ->getBrowser ();
847- $ this ->assertNull ($ client ->getInternalRequest ());
852+ $ client ->getInternalRequest ();
848853 }
849854}
0 commit comments