Skip to content

Commit

Permalink
fix: refactor test
Browse files Browse the repository at this point in the history
  • Loading branch information
nVuln committed Jul 25, 2024
1 parent 9f15681 commit 34ed864
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
8 changes: 0 additions & 8 deletions tests/Resources/AffiliateCreatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ class AffiliateCreatorTest extends TestResource
{
public const TEST_API_VERSION = 202405;

protected function tiktokShopClientForTest()
{
$client = parent::tiktokShopClientForTest();
$client->useVersion(self::TEST_API_VERSION);

return $client;
}

public function testAddShowcaseProducts()
{
$this->caller->addShowcaseProducts('add_type', [1, 2, 3], 'product_link');
Expand Down
8 changes: 0 additions & 8 deletions tests/Resources/AffiliateSellerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ class AffiliateSellerTest extends TestResource
{
public const TEST_API_VERSION = 202405;

protected function tiktokShopClientForTest()
{
$client = parent::tiktokShopClientForTest();
$client->useVersion(self::TEST_API_VERSION);

return $client;
}

public function testEditOpenCollaborationSettings()
{
$this->caller->editOpenCollaborationSettings([]);
Expand Down
5 changes: 4 additions & 1 deletion tests/TestResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ protected function setUp(): void

protected function tiktokShopClientForTest()
{
return new TiktokApiClient('app_key', 'app_secret');
$client = new TiktokApiClient('app_key', 'app_secret');
$client->useVersion(static::TEST_API_VERSION);

return $client;
}

protected function assertPreviousRequest($method, $uri)
Expand Down

0 comments on commit 34ed864

Please sign in to comment.