@@ -310,22 +310,26 @@ document::
310310 ),
311311 'the "Content-Type" header is "application/json"' // optional message shown on failure
312312 );
313-
313+ //or
314+ $this->assertResponseHeaderSame('Content-Type', 'application/json', 'the "Content-Type" header is "application/json"');
314315 // asserts that the response content contains a string
315316 $this->assertContains('foo', $client->getResponse()->getContent());
316317 // ...or matches a regex
317318 $this->assertRegExp('/foo(bar)?/', $client->getResponse()->getContent());
318319
319320 // asserts that the response status code is 2xx
320321 $this->assertTrue($client->getResponse()->isSuccessful(), 'response status is 2xx');
322+ // ...or simply
323+ $this->assertResponseIsSuccessful('response status is 2xx');
321324 // asserts that the response status code is 404
322325 $this->assertTrue($client->getResponse()->isNotFound());
323326 // asserts a specific 200 status code
324327 $this->assertEquals(
325328 200, // or Symfony\Component\HttpFoundation\Response::HTTP_OK
326329 $client->getResponse()->getStatusCode()
327330 );
328-
331+ //...or simply
332+ $this->assertResponseStatusCodeSame(200);
329333 // asserts that the response is a redirect to /demo/contact
330334 $this->assertTrue(
331335 $client->getResponse()->isRedirect('/demo/contact')
@@ -334,7 +338,8 @@ document::
334338 );
335339 // ...or simply check that the response is a redirect to any URL
336340 $this->assertTrue($client->getResponse()->isRedirect());
337-
341+ // ...or simply
342+ $this->assertResponseRedirects();
338343.. _testing-data-providers :
339344
340345Testing against Different Sets of Data
0 commit comments