@@ -19,6 +19,58 @@ public function toStringReturnsHTTPRequestMessage()
1919 $ this ->assertSame ($ expected , $ requestData ->__toString ());
2020 }
2121
22+ /** @test */
23+ public function toStringReturnsHTTPRequestMessageWithEmptyQueryString ()
24+ {
25+ $ requestData = new RequestData ('GET ' , 'http://www.example.com/path?hello=world ' );
26+
27+ $ expected = "GET /path?hello=world HTTP/1.0 \r\n" .
28+ "Host: www.example.com \r\n" .
29+ "User-Agent: React/alpha \r\n" .
30+ "\r\n" ;
31+
32+ $ this ->assertSame ($ expected , $ requestData ->__toString ());
33+ }
34+
35+ /** @test */
36+ public function toStringReturnsHTTPRequestMessageWithZeroQueryStringAndRootPath ()
37+ {
38+ $ requestData = new RequestData ('GET ' , 'http://www.example.com?0 ' );
39+
40+ $ expected = "GET /?0 HTTP/1.0 \r\n" .
41+ "Host: www.example.com \r\n" .
42+ "User-Agent: React/alpha \r\n" .
43+ "\r\n" ;
44+
45+ $ this ->assertSame ($ expected , $ requestData ->__toString ());
46+ }
47+
48+ /** @test */
49+ public function toStringReturnsHTTPRequestMessageWithOptionsAbsoluteRequestForm ()
50+ {
51+ $ requestData = new RequestData ('OPTIONS ' , 'http://www.example.com/ ' );
52+
53+ $ expected = "OPTIONS / HTTP/1.0 \r\n" .
54+ "Host: www.example.com \r\n" .
55+ "User-Agent: React/alpha \r\n" .
56+ "\r\n" ;
57+
58+ $ this ->assertSame ($ expected , $ requestData ->__toString ());
59+ }
60+
61+ /** @test */
62+ public function toStringReturnsHTTPRequestMessageWithOptionsAsteriskRequestForm ()
63+ {
64+ $ requestData = new RequestData ('OPTIONS ' , 'http://www.example.com ' );
65+
66+ $ expected = "OPTIONS * HTTP/1.0 \r\n" .
67+ "Host: www.example.com \r\n" .
68+ "User-Agent: React/alpha \r\n" .
69+ "\r\n" ;
70+
71+ $ this ->assertSame ($ expected , $ requestData ->__toString ());
72+ }
73+
2274 /** @test */
2375 public function toStringReturnsHTTPRequestMessageWithProtocolVersion ()
2476 {
0 commit comments