From ec66a4fdc5567994f8ffa61edf870983e24ec54d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 27 May 2021 12:45:29 +1000 Subject: [PATCH] Verbose error messaging in tests --- tests/Feature/UserTest.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/Feature/UserTest.php b/tests/Feature/UserTest.php index 7d573549342f..0e7b0fd0f88c 100644 --- a/tests/Feature/UserTest.php +++ b/tests/Feature/UserTest.php @@ -109,18 +109,19 @@ class UserTest extends TestCase $response = false; -// try { + try { $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token, 'X-API-PASSWORD' => 'ALongAndBriliantPassword', ])->post('/api/v1/users?include=company_user', $data); - // } catch (ValidationException $e) { - // $message = json_decode($e->validator->getMessageBag(), 1); - // nlog($message); - // $this->assertNotNull($message); - // } + } catch (ValidationException $e) { + $message = json_decode($e->validator->getMessageBag(), 1); + nlog($message); + var_dump($message); + $this->assertNotNull($message); + } $response->assertStatus(200);