public function testInvokingWithExceptionInNonProductionModeIncludesTraceInResponseBody() { $error = new Exception('foo', 400); $this->final = new FinalHandler(['env' => 'not-production']); $response = call_user_func($this->final, $this->request, $this->response, $error); $expected = $this->escaper->escapeHtml($error->getTraceAsString()); $this->assertContains($expected, (string) $response->getBody()); }