From 46eb5251892477e11c5e79d03de3b44c2e17f909 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 12 Dec 2023 11:37:49 +1100 Subject: [PATCH] Catch for paypal script not loading --- tests/Feature/Scheduler/SchedulerTest.php | 34 ++++++++--------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/tests/Feature/Scheduler/SchedulerTest.php b/tests/Feature/Scheduler/SchedulerTest.php index 56b70ab5c2..861a2111bd 100644 --- a/tests/Feature/Scheduler/SchedulerTest.php +++ b/tests/Feature/Scheduler/SchedulerTest.php @@ -445,17 +445,11 @@ class SchedulerTest extends TestCase ]; $response = false; - - try { - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->postJson('/api/v1/task_schedulers', $data); - } catch (ValidationException $e) { - $message = json_decode($e->validator->getMessageBag(), 1); - nlog($message); - } - + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->postJson('/api/v1/task_schedulers', $data); + $response->assertStatus(200); $data = $response->json(); @@ -509,19 +503,13 @@ class SchedulerTest extends TestCase $response = false; - try { - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->postJson('/api/v1/task_schedulers', $data); - } catch (ValidationException $e) { - $message = json_decode($e->validator->getMessageBag(), 1); - nlog($message); - } - + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->postJson('/api/v1/task_schedulers', $data); + $response->assertStatus(200); - - + $data = [ 'name' => 'A single Client', 'frequency_id' => RecurringInvoice::FREQUENCY_MONTHLY,