@@ -151,8 +151,8 @@ public function testListenInvokesCallbackAndSendsResponse()
151151 $ this ->expectOutputString ('FOOBAR ' );
152152 $ server ->listen ();
153153
154- $ this ->assertContains ( 'HTTP/1.1 200 OK ' , HeaderStack:: stack ( ));
155- $ this ->assertContains ( 'Content-Type: text/plain ' , HeaderStack:: stack ( ));
154+ $ this ->assertTrue (HeaderStack:: has ( 'HTTP/1.1 200 OK ' ));
155+ $ this ->assertTrue (HeaderStack:: has ( 'Content-Type: text/plain ' ));
156156 }
157157
158158 public function testListenEmitsStatusHeaderWithoutReasonPhraseIfNoReasonPhrase ()
@@ -176,8 +176,8 @@ public function testListenEmitsStatusHeaderWithoutReasonPhraseIfNoReasonPhrase()
176176 $ this ->expectOutputString ('FOOBAR ' );
177177 $ server ->listen ();
178178
179- $ this ->assertContains ( 'HTTP/1.1 299 ' , HeaderStack:: stack ( ));
180- $ this ->assertContains ( 'Content-Type: text/plain ' , HeaderStack:: stack ( ));
179+ $ this ->assertTrue (HeaderStack:: has ( 'HTTP/1.1 299 ' ));
180+ $ this ->assertTrue (HeaderStack:: has ( 'Content-Type: text/plain ' ));
181181 }
182182
183183 public function testEnsurePercentCharactersDoNotResultInOutputError ()
@@ -200,8 +200,8 @@ public function testEnsurePercentCharactersDoNotResultInOutputError()
200200 $ this ->expectOutputString ('100% ' );
201201 $ server ->listen ();
202202
203- $ this ->assertContains ( 'HTTP/1.1 200 OK ' , HeaderStack:: stack ( ));
204- $ this ->assertContains ( 'Content-Type: text/plain ' , HeaderStack:: stack ( ));
203+ $ this ->assertTrue (HeaderStack:: has ( 'HTTP/1.1 200 OK ' ));
204+ $ this ->assertTrue (HeaderStack:: has ( 'Content-Type: text/plain ' ));
205205 }
206206
207207 public function testEmitsHeadersWithMultipleValuesMultipleTimes ()
@@ -228,19 +228,16 @@ public function testEmitsHeadersWithMultipleValuesMultipleTimes()
228228
229229 $ server ->listen ();
230230
231- $ this ->assertContains ('HTTP/1.1 200 OK ' , HeaderStack::stack ());
232- $ this ->assertContains ('Content-Type: text/plain ' , HeaderStack::stack ());
233- $ this ->assertContains (
234- 'Set-Cookie: foo=bar; expires=Wed, 1 Oct 2014 10:30; path=/foo; domain=example.com ' ,
235- HeaderStack::stack ()
231+ $ this ->assertTrue (HeaderStack::has ('HTTP/1.1 200 OK ' ));
232+ $ this ->assertTrue (HeaderStack::has ('Content-Type: text/plain ' ));
233+ $ this ->assertTrue (
234+ HeaderStack::has ('Set-Cookie: foo=bar; expires=Wed, 1 Oct 2014 10:30; path=/foo; domain=example.com ' )
236235 );
237- $ this ->assertContains (
238- 'Set-Cookie: bar=baz; expires=Wed, 8 Oct 2014 10:30; path=/foo/bar; domain=example.com ' ,
239- HeaderStack::stack ()
236+ $ this ->assertTrue (
237+ HeaderStack::has ('Set-Cookie: bar=baz; expires=Wed, 8 Oct 2014 10:30; path=/foo/bar; domain=example.com ' )
240238 );
241239
242- $ stack = HeaderStack::stack ();
243- return $ stack ;
240+ return HeaderStack::stack ();
244241 }
245242
246243 /**
@@ -249,16 +246,23 @@ public function testEmitsHeadersWithMultipleValuesMultipleTimes()
249246 */
250247 public function testHeaderOrderIsHonoredWhenEmitted ($ stack )
251248 {
249+ $ header = array_pop ($ stack );
250+ $ this ->assertContains ('Content-Type: text/plain ' , $ header );
251+
252252 $ header = array_pop ($ stack );
253253 $ this ->assertContains (
254254 'Set-Cookie: bar=baz; expires=Wed, 8 Oct 2014 10:30; path=/foo/bar; domain=example.com ' ,
255255 $ header
256256 );
257+
257258 $ header = array_pop ($ stack );
258259 $ this ->assertContains (
259260 'Set-Cookie: foo=bar; expires=Wed, 1 Oct 2014 10:30; path=/foo; domain=example.com ' ,
260261 $ header
261262 );
263+
264+ $ header = array_pop ($ stack );
265+ $ this ->assertContains ('HTTP/1.1 200 OK ' , $ header );
262266 }
263267
264268 public function testListenPassesCallableArgumentToCallback ()
0 commit comments