Skip to content

Commit 6956605

Browse files
add test
1 parent 109f0bb commit 6956605

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/Containers/AppSection/User/Tests/Unit/FindUserByIdTaskTest.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Containers\AppSection\User\Tests\Unit;
44

5+
use App\Containers\AppSection\User\Models\User;
56
use App\Containers\AppSection\User\Tasks\FindUserByIdTask;
67
use App\Containers\AppSection\User\Tests\TestCase;
78
use App\Ship\Exceptions\NotFoundException;
@@ -14,10 +15,18 @@
1415
*/
1516
class FindUserByIdTaskTest extends TestCase
1617
{
18+
public function testFindUserById(): void
19+
{
20+
$user = User::factory()->create();
21+
22+
$foundUser = app(FindUserByIdTask::class)->run($user->id);
23+
24+
$this->assertEquals($user->id, $foundUser->id);
25+
}
26+
1727
public function testFindUserWithInvalidId(): void
1828
{
1929
$this->expectException(NotFoundException::class);
20-
$this->expectExceptionMessage('The requested Resource was not found.');
2130

2231
$noneExistingId = 777777;
2332

0 commit comments

Comments
 (0)