Add form request validation tests for various client and admin requests
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Requests\Client;
|
||||
|
||||
use App\Http\Requests\Client\CaseRejectRequest;
|
||||
use Tests\Concerns\ValidatesFormRequests;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CaseRejectRequestTest extends TestCase
|
||||
{
|
||||
use ValidatesFormRequests;
|
||||
|
||||
public function test_passes_with_reason(): void
|
||||
{
|
||||
$this->assertPasses(CaseRejectRequest::class, ['reason' => 'تصاویر ناخوانا هستند']);
|
||||
}
|
||||
|
||||
public function test_fails_without_reason(): void
|
||||
{
|
||||
$this->assertFailsOn('reason', CaseRejectRequest::class, []);
|
||||
$this->assertFailsOn('reason', CaseRejectRequest::class, ['reason' => '']);
|
||||
}
|
||||
|
||||
public function test_fails_when_reason_exceeds_limit(): void
|
||||
{
|
||||
$this->assertFailsOn('reason', CaseRejectRequest::class, ['reason' => str_repeat('a', 1001)]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user