@@ -50,13 +50,27 @@ public function testSendHeaders()
50
50
public function testSend ()
51
51
{
52
52
$ response = new Response ();
53
- $ responseSend = $ response ->send ();
54
- $ this ->assertObjectHasAttribute ('headers ' , $ responseSend );
55
- $ this ->assertObjectHasAttribute ('content ' , $ responseSend );
56
- $ this ->assertObjectHasAttribute ('version ' , $ responseSend );
57
- $ this ->assertObjectHasAttribute ('statusCode ' , $ responseSend );
58
- $ this ->assertObjectHasAttribute ('statusText ' , $ responseSend );
59
- $ this ->assertObjectHasAttribute ('charset ' , $ responseSend );
53
+ $ responseSent = $ response ->send ();
54
+ $ this ->assertObjectHasAttribute ('headers ' , $ responseSent );
55
+ $ this ->assertObjectHasAttribute ('content ' , $ responseSent );
56
+ $ this ->assertObjectHasAttribute ('version ' , $ responseSent );
57
+ $ this ->assertObjectHasAttribute ('statusCode ' , $ responseSent );
58
+ $ this ->assertObjectHasAttribute ('statusText ' , $ responseSent );
59
+ $ this ->assertObjectHasAttribute ('charset ' , $ responseSent );
60
+ $ this ->assertFalse ($ responseSent ->headers ->has ('Content-Length ' ));
61
+
62
+ ob_start ();
63
+
64
+ $ response = new Response ('foo ' );
65
+ $ responseSent = $ response ->send ();
66
+ $ this ->assertSame ('3 ' , $ responseSent ->headers ->get ('Content-Length ' ));
67
+
68
+ $ response = new Response ('bar ' );
69
+ $ response ->headers ->set ('Transfer-Encoding ' , 'chunked ' );
70
+ $ responseSent = $ response ->send ();
71
+ $ this ->assertFalse ($ responseSent ->headers ->has ('Content-Length ' ));
72
+
73
+ $ this ->assertSame ('foobar ' , ob_get_clean ());
60
74
}
61
75
62
76
public function testGetCharset ()
0 commit comments