@@ -48,11 +48,12 @@ public function testGetRequest()
48
48
49
49
public function testGetRequestNull ()
50
50
{
51
+ $ client = $ this ->getBrowser ();
52
+
51
53
$ this ->expectException (BadMethodCallException::class);
52
54
$ this ->expectExceptionMessage ('The "request()" method must be called before "Symfony \\Component \\BrowserKit \\AbstractBrowser::getRequest()". ' );
53
55
54
- $ client = $ this ->getBrowser ();
55
- $ this ->assertNull ($ client ->getRequest ());
56
+ $ client ->getRequest ();
56
57
}
57
58
58
59
public function testXmlHttpRequest ()
@@ -96,20 +97,22 @@ public function testGetResponse()
96
97
97
98
public function testGetResponseNull ()
98
99
{
100
+ $ client = $ this ->getBrowser ();
101
+
99
102
$ this ->expectException (BadMethodCallException::class);
100
103
$ this ->expectExceptionMessage ('The "request()" method must be called before "Symfony \\Component \\BrowserKit \\AbstractBrowser::getResponse()". ' );
101
104
102
- $ client = $ this ->getBrowser ();
103
- $ this ->assertNull ($ client ->getResponse ());
105
+ $ client ->getResponse ();
104
106
}
105
107
106
108
public function testGetInternalResponseNull ()
107
109
{
110
+ $ client = $ this ->getBrowser ();
111
+
108
112
$ this ->expectException (BadMethodCallException::class);
109
113
$ this ->expectExceptionMessage ('The "request()" method must be called before "Symfony \\Component \\BrowserKit \\AbstractBrowser::getInternalResponse()". ' );
110
114
111
- $ client = $ this ->getBrowser ();
112
- $ this ->assertNull ($ client ->getInternalResponse ());
115
+ $ client ->getInternalResponse ();
113
116
}
114
117
115
118
public function testGetContent ()
@@ -132,11 +135,12 @@ public function testGetCrawler()
132
135
133
136
public function testGetCrawlerNull ()
134
137
{
138
+ $ client = $ this ->getBrowser ();
139
+
135
140
$ this ->expectException (BadMethodCallException::class);
136
141
$ this ->expectExceptionMessage ('The "request()" method must be called before "Symfony \\Component \\BrowserKit \\AbstractBrowser::getCrawler()". ' );
137
142
138
- $ client = $ this ->getBrowser ();
139
- $ this ->assertNull ($ client ->getCrawler ());
143
+ $ client ->getCrawler ();
140
144
}
141
145
142
146
public function testRequestHttpHeaders ()
@@ -418,7 +422,7 @@ public function testSubmitPreserveAuth()
418
422
$ this ->assertSame ('bar ' , $ server ['PHP_AUTH_PW ' ]);
419
423
}
420
424
421
- public function testSubmitPassthrewHeaders ()
425
+ public function testSubmitPassthroughHeaders ()
422
426
{
423
427
$ client = $ this ->getBrowser ();
424
428
$ client ->setNextResponse (new Response ('<html><form action="/foo"><input type="submit" /></form></html> ' ));
@@ -657,7 +661,7 @@ public function testFollowMetaRefresh(string $content, string $expectedEndingUrl
657
661
$ this ->assertSame ($ expectedEndingUrl , $ client ->getRequest ()->getUri ());
658
662
}
659
663
660
- public static function getTestsForMetaRefresh ()
664
+ public static function getTestsForMetaRefresh (): array
661
665
{
662
666
return [
663
667
['<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()
878
882
879
883
public function testInternalRequestNull ()
880
884
{
885
+ $ client = $ this ->getBrowser ();
886
+
881
887
$ this ->expectException (BadMethodCallException::class);
882
888
$ this ->expectExceptionMessage ('The "request()" method must be called before "Symfony \\Component \\BrowserKit \\AbstractBrowser::getInternalRequest()". ' );
883
889
884
- $ client = $ this ->getBrowser ();
885
- $ this ->assertNull ($ client ->getInternalRequest ());
890
+ $ client ->getInternalRequest ();
886
891
}
887
892
}
0 commit comments