Skip to content

Commit

Permalink
udate
Browse files Browse the repository at this point in the history
  • Loading branch information
bobicloudvision committed Apr 22, 2024
1 parent 33b3cb8 commit 366f463
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion web/app/Http/Controllers/Api/Request/ApiRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function failedValidation(Validator $validator)
throw new HttpResponseException(response()->json([
'error' => true,
'message' => $validator->errors()->first(),
'data' => $validator->errors(),
'errors' => $validator->errors(),
]));
}
}
8 changes: 4 additions & 4 deletions web/tests/Unit/SecurityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ public function testSecurity()

$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
Expand Down

0 comments on commit 366f463

Please sign in to comment.