use Symfony\Component\BrowserKit\Cookie; use Symfony\Component\BrowserKit\CookieJar; use Symfony\Component\DomCrawler\Crawler; use Symfony\Component\HttpFoundation\Cookie as HttpFoundationCookie; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response;
classWebTestCaseTestextends TestCase { publicfunctiontestAssertResponseIsSuccessful() { $this->getResponseTester(newResponse())->assertResponseIsSuccessful(); $this->expectException(AssertionFailedError::class); $this->expectExceptionMessage("Failed asserting that the Response is successful.\nHTTP/1.0 404 Not Found"); $this->getResponseTester(newResponse('', 404))->assertResponseIsSuccessful(); }