This commit is contained in:
Bozhidar 2024-04-22 17:17:57 +03:00
parent 33b3cb82eb
commit 366f4638b9
2 changed files with 5 additions and 5 deletions

View file

@ -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(),
]));
}
}

View file

@ -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