Skip to content

Commit

Permalink
Add testUpdateUser
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenclouston committed Oct 1, 2024
1 parent 0a7152f commit b48141f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/AuthsignalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,22 @@ public function testValidateChallengeOptionalUserId() {

$this->assertEquals($response["isValid"], "true");
}

public function testUpdateUser() {
$mockedResponse = array(
"userId" => "550e8400-e29b-41d4-a716-446655440000",
"email" => "updated_email",
);

self::$server->setResponseOfPath("/v1/users/550e8400-e29b-41d4-a716-446655440000", new Response(json_encode($mockedResponse)));

$data = array(
"email" => "updated_email",
);

$response = Authsignal::updateUser("550e8400-e29b-41d4-a716-446655440000", $data);

$this->assertEquals($response["userId"], $mockedResponse["userId"]);
$this->assertEquals($response["email"], $mockedResponse["email"]);
}
}

0 comments on commit b48141f

Please sign in to comment.