From e80caa68275ae8222cf1dd565d87972e23e0aaa6 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Wed, 10 Jan 2018 18:49:42 -0600 Subject: [PATCH] Add better debugging on GET reqs since the build failed #35 --- tests/PilotTest.php | 4 ++-- tests/TestCase.php | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/PilotTest.php b/tests/PilotTest.php index 205d331a..4b60351d 100644 --- a/tests/PilotTest.php +++ b/tests/PilotTest.php @@ -38,7 +38,7 @@ class PilotTest extends TestCase /** * Check via API */ - $resp = $this->get('/api/user/fleet', [], $user); + $resp = $this->get('/api/user/fleet', [], $user)->assertStatus(200); $body = $resp->json(); # Get the subfleet that's been added in @@ -52,7 +52,7 @@ class PilotTest extends TestCase /** * Check the user ID call */ - $resp = $this->get('/api/users/'.$user->id.'/fleet', [], $user); + $resp = $this->get('/api/users/'.$user->id.'/fleet', [], $user)->assertStatus(200); $body = $resp->json(); # Get the subfleet that's been added in diff --git a/tests/TestCase.php b/tests/TestCase.php index fec3c3fb..022c9895 100755 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -124,7 +124,13 @@ abstract class TestCase extends Illuminate\Foundation\Testing\TestCase $headers['x-api-key'] = $user->api_key; } - return parent::get($uri, $headers); + $req = parent::get($uri, $headers); + if($req->isClientError() || $req->isServerError()) { + Log::error('Error on '.$uri); + Log::error($req->json()); + } + + return $req; } /**