From 366f4638b965cf5f442b16090d185b2ae15509a6 Mon Sep 17 00:00:00 2001 From: Bozhidar Date: Mon, 22 Apr 2024 17:17:57 +0300 Subject: [PATCH] udate --- web/app/Http/Controllers/Api/Request/ApiRequest.php | 2 +- web/tests/Unit/SecurityTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/app/Http/Controllers/Api/Request/ApiRequest.php b/web/app/Http/Controllers/Api/Request/ApiRequest.php index 2ff60b1..3b540f4 100644 --- a/web/app/Http/Controllers/Api/Request/ApiRequest.php +++ b/web/app/Http/Controllers/Api/Request/ApiRequest.php @@ -13,7 +13,7 @@ class ApiRequest extends FormRequest throw new HttpResponseException(response()->json([ 'error' => true, 'message' => $validator->errors()->first(), - 'data' => $validator->errors(), + 'errors' => $validator->errors(), ])); } } diff --git a/web/tests/Unit/SecurityTest.php b/web/tests/Unit/SecurityTest.php index 308687a..f8093fd 100644 --- a/web/tests/Unit/SecurityTest.php +++ b/web/tests/Unit/SecurityTest.php @@ -20,12 +20,12 @@ class SecurityTest extends ActionTestCase $this->assertArrayHasKey('error', $callHostingSubscriptionStoreResponse); $this->assertArrayHasKey('message', $callHostingSubscriptionStoreResponse); - $this->assertArrayHasKey('data', $callHostingSubscriptionStoreResponse); - $this->assertArrayHasKey('domain', $callHostingSubscriptionStoreResponse['data']); + $this->assertArrayHasKey('errors', $callHostingSubscriptionStoreResponse); + $this->assertArrayHasKey('domain', $callHostingSubscriptionStoreResponse['errors']); $this->assertSame('The selected customer id is invalid.', $callHostingSubscriptionStoreResponse['message']); - $this->assertSame('The selected hosting plan id is invalid.', $callHostingSubscriptionStoreResponse['data']['hosting_plan_id'][0]); - $this->assertSame('The domain field format is invalid.', $callHostingSubscriptionStoreResponse['data']['domain'][0]); + $this->assertSame('The selected hosting plan id is invalid.', $callHostingSubscriptionStoreResponse['errors']['hosting_plan_id'][0]); + $this->assertSame('The domain field format is invalid.', $callHostingSubscriptionStoreResponse['errors']['domain'][0]); // Create a customer