From 2271b94bb3dfbeff56c5b8aaaf91b73e52b825b3 Mon Sep 17 00:00:00 2001 From: David Yell Date: Mon, 27 Feb 2017 14:13:07 +0000 Subject: [PATCH] Refactored out the Heredoc syntax in favour of array comparison to remove potential non-matches due to json formatting --- tests/TestCase/Error/ExceptionRendererTest.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/TestCase/Error/ExceptionRendererTest.php b/tests/TestCase/Error/ExceptionRendererTest.php index 28088c26833..5860fcb2268 100644 --- a/tests/TestCase/Error/ExceptionRendererTest.php +++ b/tests/TestCase/Error/ExceptionRendererTest.php @@ -437,16 +437,13 @@ public function testError400AsJson() $ExceptionRenderer->controller->response->expects($this->once())->method('statusCode')->with(404); $result = $ExceptionRenderer->render()->body(); + $expected = [ + 'message' => 'Custom message', + 'url' => '/posts/view/1000?sort=title&direction=desc', + 'code' => 404 + ]; - $expected = <<assertTextEquals($expected, $result); + $this->assertEquals($expected, json_decode($result, true)); } /**