Skip to content

Commit

Permalink
Updates PHPUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
José San Martin committed May 3, 2024
1 parent c04ea43 commit 987dd75
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/unit/src/SlashIdSdkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use GuzzleHttp\Exception\ClientException;
use PHPUnit\Framework\TestCase;
use SlashId\Php\Abstraction\MigrationAbstraction;
use SlashId\Php\Abstraction\TokenAbstraction;
use SlashId\Php\Abstraction\WebhookAbstraction;
use SlashId\Php\Exception\AccessDeniedException;
use SlashId\Php\Exception\BadRequestException;
Expand Down Expand Up @@ -77,6 +78,20 @@ public function testMigration(): void
$this->assertEquals(spl_object_hash($migration), spl_object_hash($resultOfSecondCall));
}

/**
* Tests token().
*/
public function testToken(): void
{
$sdk = $this->sdk();
$token = $sdk->token();
$this->assertInstanceOf(TokenAbstraction::class, $token);

// Tests that the class is instantiated just once.
$resultOfSecondCall = $sdk->token();
$this->assertEquals(spl_object_hash($token), spl_object_hash($resultOfSecondCall));
}

/**
* Tests webhook().
*/
Expand Down

0 comments on commit 987dd75

Please sign in to comment.