@@ -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 ()
@@ -380,7 +384,7 @@ public function testSubmitPreserveAuth()
380
384
$ this ->assertSame ('bar ' , $ server ['PHP_AUTH_PW ' ]);
381
385
}
382
386
383
- public function testSubmitPassthrewHeaders ()
387
+ public function testSubmitPassthroughHeaders ()
384
388
{
385
389
$ client = $ this ->getBrowser ();
386
390
$ client ->setNextResponse (new Response ('<html><form action="/foo"><input type="submit" /></form></html> ' ));
@@ -619,7 +623,7 @@ public function testFollowMetaRefresh(string $content, string $expectedEndingUrl
619
623
$ this ->assertSame ($ expectedEndingUrl , $ client ->getRequest ()->getUri ());
620
624
}
621
625
622
- public static function getTestsForMetaRefresh ()
626
+ public static function getTestsForMetaRefresh (): array
623
627
{
624
628
return [
625
629
['<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()
840
844
841
845
public function testInternalRequestNull ()
842
846
{
847
+ $ client = $ this ->getBrowser ();
848
+
843
849
$ this ->expectException (BadMethodCallException::class);
844
850
$ this ->expectExceptionMessage ('The "request()" method must be called before "Symfony \\Component \\BrowserKit \\AbstractBrowser::getInternalRequest()". ' );
845
851
846
- $ client = $ this ->getBrowser ();
847
- $ this ->assertNull ($ client ->getInternalRequest ());
852
+ $ client ->getInternalRequest ();
848
853
}
849
854
}
0 commit comments