Skip to content

Commit

Permalink
Remove token instance tests from example
Browse files Browse the repository at this point in the history
  • Loading branch information
sprain committed Oct 4, 2023
1 parent fb753f3 commit 6650777
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions test/ApiClient/TicketparkApiClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Ticketpark\ApiClient\Test;

use Buzz\Browser;
use Buzz\Message\Response;
use PHPUnit\Framework\TestCase;
use Ticketpark\ApiClient\Exception\TokenGenerationException;
use Ticketpark\ApiClient\TicketparkApiClient;
Expand All @@ -18,45 +16,20 @@ public function setUp(): void
{
$this->apiClient = new TicketparkApiClient('apiKey', 'apiSecret');
}

public function testDefaultBrowser()
{
$this->assertInstanceOf(Browser::class, $this->apiClient->getBrowser());
}

public function testSetAccessToken()
{
$this->apiClient->setAccessToken('foo');
$this->assertInstanceOf(AccessToken::class, $this->apiClient->getAccessToken());
$this->assertEquals('foo', $this->apiClient->getAccessToken()->getToken());
}

public function testSetAccessTokenInstance()
{
$accessToken = new AccessToken('bar');
$this->apiClient->setAccessTokenInstance($accessToken);

$this->assertInstanceOf(AccessToken::class, $this->apiClient->getAccessToken());
$this->assertEquals('bar', $this->apiClient->getAccessToken()->getToken());
}

public function testSetRefreshToken()
{
$this->apiClient->setRefreshToken('foo');
$this->assertInstanceOf(RefreshToken::class, $this->apiClient->getRefreshToken());
$this->assertEquals('foo', $this->apiClient->getRefreshToken()->getToken());
}

public function testSetRefreshTokenInstance()
{
$refreshToken = new RefreshToken('bar');
$this->apiClient->setRefreshTokenInstance($refreshToken);

$this->assertInstanceOf(RefreshToken::class, $this->apiClient->getRefreshToken());
$this->assertEquals('bar', $this->apiClient->getRefreshToken()->getToken());
}

public function testGenerateTokensWithoutData()
public function testGenerateTokensWithoutDataThrowsException()
{
$this->expectException(TokenGenerationException::class);

Expand Down

0 comments on commit 6650777

Please sign in to comment.