Add form request validation tests for various client and admin requests

This commit is contained in:
2026-09-21 05:24:50 +03:30
parent f77ff527e7
commit e987a528ef
21 changed files with 1061 additions and 23 deletions
@@ -0,0 +1,28 @@
<?php
namespace Tests\Feature\Requests\Admin;
use App\Http\Requests\Admin\WithdrawRejectRequest;
use Tests\Concerns\ValidatesFormRequests;
use Tests\TestCase;
class WithdrawRejectRequestTest extends TestCase
{
use ValidatesFormRequests;
public function test_passes_without_note(): void
{
$this->assertPasses(WithdrawRejectRequest::class, []);
$this->assertPasses(WithdrawRejectRequest::class, ['note' => null]);
}
public function test_passes_with_note(): void
{
$this->assertPasses(WithdrawRejectRequest::class, ['note' => 'اطلاعات کارت ناقص است']);
}
public function test_fails_when_note_exceeds_limit(): void
{
$this->assertFailsOn('note', WithdrawRejectRequest::class, ['note' => str_repeat('a', 1001)]);
}
}