Skip to content

Commit

Permalink
test: fix test assertions to match new implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ctran88 committed Dec 5, 2024
1 parent ad21f9b commit c0795cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions custom/test/AuthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Passage\Test;

use Dotenv\Dotenv;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use Passage\Client\Passage;
use UnexpectedValueException;

class AuthTest extends TestCase
{
Expand Down Expand Up @@ -38,8 +38,8 @@ public function testValidateJwtValidToken()

public function testValidateJwtInvalidTokenStructure()
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid JWT format');
$this->expectException(UnexpectedValueException::class);
$this->expectExceptionMessage('Wrong number of segments');
$this->passage->auth->validateJwt('incorrect.token');
}
}
5 changes: 3 additions & 2 deletions custom/test/PassageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ public function testPassageVersionHeader()

public function testConstructorWithAppId()
{
$passage = new Passage('123456', '987654');

$passage = new Passage($this->appId, $this->apiKey);

// Assert that the object was created successfully
$this->assertInstanceOf(Passage::class, $passage);

// Assert that app_id and api_key properties are correctly set
$this->assertEquals('123456', $passage->getAppId());
$this->assertEquals($this->appId, $passage->getAppId());
}

public function testGetApp()
Expand Down

0 comments on commit c0795cb

Please sign in to comment.