From 5af843673d65fabff1293393028724fbff92c44a Mon Sep 17 00:00:00 2001 From: mohammad-alavi Date: Fri, 1 Oct 2021 11:55:22 +0330 Subject: [PATCH] add test --- .../AppSection/User/Tests/Unit/DeleteUserTaskTest.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Containers/AppSection/User/Tests/Unit/DeleteUserTaskTest.php b/app/Containers/AppSection/User/Tests/Unit/DeleteUserTaskTest.php index 28e1f8e0f..2aa022a94 100644 --- a/app/Containers/AppSection/User/Tests/Unit/DeleteUserTaskTest.php +++ b/app/Containers/AppSection/User/Tests/Unit/DeleteUserTaskTest.php @@ -2,9 +2,9 @@ namespace App\Containers\AppSection\User\Tests\Unit; +use App\Containers\AppSection\User\Models\User; use App\Containers\AppSection\User\Tasks\DeleteUserTask; use App\Containers\AppSection\User\Tests\TestCase; -use App\Ship\Exceptions\DeleteResourceFailedException; use App\Ship\Exceptions\NotFoundException; /** @@ -15,6 +15,15 @@ */ class DeleteUserTaskTest extends TestCase { + public function testDeleteUser(): void + { + $user = User::factory()->create(); + + $result = app(DeleteUserTask::class)->run($user->id); + + $this->assertEquals(1, $result); + } + public function testDeleteUserWithInvalidId(): void { $this->expectException(NotFoundException::class);