Skip to content

Commit

Permalink
add updateUserTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Oct 1, 2021
1 parent 5af8436 commit e5caab6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/Containers/AppSection/User/Tests/Unit/UpdateUserTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@
*/
class UpdateUserTaskTest extends TestCase
{
public function testUpdateUser(): void
{
$user = User::factory()->create();
$data = [
'name' => 'new name',
];

$updatedUser = app(UpdateUserTask::class)->run($data, $user->id);

$this->assertEquals($user->id, $updatedUser->id);
$this->assertEquals($data['name'], $updatedUser->name);
}

public function testUpdateUserWithInvalidID(): void
{
$this->expectException(NotFoundException::class);
Expand Down

0 comments on commit e5caab6

Please sign in to comment.