File tree 1 file changed +10
-1
lines changed
app/Containers/AppSection/User/Tests/Unit
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace App \Containers \AppSection \User \Tests \Unit ;
4
4
5
+ use App \Containers \AppSection \User \Models \User ;
5
6
use App \Containers \AppSection \User \Tasks \FindUserByIdTask ;
6
7
use App \Containers \AppSection \User \Tests \TestCase ;
7
8
use App \Ship \Exceptions \NotFoundException ;
14
15
*/
15
16
class FindUserByIdTaskTest extends TestCase
16
17
{
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
+
17
27
public function testFindUserWithInvalidId (): void
18
28
{
19
29
$ this ->expectException (NotFoundException::class);
20
- $ this ->expectExceptionMessage ('The requested Resource was not found. ' );
21
30
22
31
$ noneExistingId = 777777 ;
23
32
You can’t perform that action at this time.
0 commit comments