@@ -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 ()
@@ -418,7 +422,7 @@ public function testSubmitPreserveAuth()
418422 $ this ->assertSame ('bar ' , $ server ['PHP_AUTH_PW ' ]);
419423 }
420424
421- public function testSubmitPassthrewHeaders ()
425+ public function testSubmitPassthroughHeaders ()
422426 {
423427 $ client = $ this ->getBrowser ();
424428 $ client ->setNextResponse (new Response ('<html><form action="/foo"><input type="submit" /></form></html> ' ));
@@ -657,7 +661,7 @@ public function testFollowMetaRefresh(string $content, string $expectedEndingUrl
657661 $ this ->assertSame ($ expectedEndingUrl , $ client ->getRequest ()->getUri ());
658662 }
659663
660- public static function getTestsForMetaRefresh ()
664+ public static function getTestsForMetaRefresh (): array
661665 {
662666 return [
663667 ['<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 ' ],
@@ -878,10 +882,11 @@ public function testInternalRequest()
878882
879883 public function testInternalRequestNull ()
880884 {
885+ $ client = $ this ->getBrowser ();
886+
881887 $ this ->expectException (BadMethodCallException::class);
882888 $ this ->expectExceptionMessage ('The "request()" method must be called before "Symfony \\Component \\BrowserKit \\AbstractBrowser::getInternalRequest()". ' );
883889
884- $ client = $ this ->getBrowser ();
885- $ this ->assertNull ($ client ->getInternalRequest ());
890+ $ client ->getInternalRequest ();
886891 }
887892}
0 commit comments