fix(purchase): unify expired checkout errors
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Purchase;
|
||||
|
||||
use App\Domains\Purchase\Exceptions\PurchaseExpiredException;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Tests\TestCase;
|
||||
|
||||
class PurchaseExpiredExceptionResponseTest extends TestCase
|
||||
{
|
||||
public function test_it_returns_a_stable_api_error_for_an_expired_purchase(): void
|
||||
{
|
||||
Route::get('/api/test/purchase-expired', function (): never {
|
||||
throw new PurchaseExpiredException;
|
||||
});
|
||||
|
||||
$this->getJson('/api/test/purchase-expired')
|
||||
->assertUnprocessable()
|
||||
->assertExactJson([
|
||||
'code' => 'purchase.expired',
|
||||
'message' => __('api.purchase.expired'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user