Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: AffiliatePartner test #42

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions tests/Resources/AffiliatePartnerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

namespace EcomPHP\TiktokShop\Tests\Resources;

use EcomPHP\TiktokShop\Tests\TestResource;

/**
* @property-read \EcomPHP\TiktokShop\Resources\AffiliatePartner $caller
*/
class AffiliatePartnerTest extends TestResource
{
public const TEST_API_VERSION = 202405;

public function testCreateAffiliatePartnerCampaign()
{
$this->caller->createAffiliatePartnerCampaign([], []);
$this->assertPreviousRequest('POST', 'affiliate_partner/'.self::TEST_API_VERSION.'/campaigns');
}

public function testGetAffiliatePartnerCampaignProductList()
{
$this->caller->getAffiliatePartnerCampaignProductList(1, []);
$this->assertPreviousRequest('GET', 'affiliate_partner/'.self::TEST_API_VERSION.'/campaigns/1/products');
}

public function testGetAffiliatePartnerCampaignDetail()
{
$this->caller->getAffiliatePartnerCampaignDetail(1, []);
$this->assertPreviousRequest('GET', 'affiliate_partner/'.self::TEST_API_VERSION.'/campaigns/1');
}

public function testReviewAffiliatePartnerCampaignProduct()
{
$this->caller->reviewAffiliatePartnerCampaignProduct(1, 2, [], []);
$this->assertPreviousRequest('POST', 'affiliate_partner/'.self::TEST_API_VERSION.'/campaigns/1/products/2/review');
}

public function testEditAffiliatePartnerCampaign()
{
$this->caller->editAffiliatePartnerCampaign(1, [], []);
$this->assertPreviousRequest('POST', 'affiliate_partner/'.self::TEST_API_VERSION.'/campaigns/1/partial_edit');
}

public function testGetAffiliatePartnerCampaignList()
{
$this->caller->getAffiliatePartnerCampaignList([]);
$this->assertPreviousRequest('GET', 'affiliate_partner/'.self::TEST_API_VERSION.'/campaigns');
}

public function testPublishAffiliatePartnerCampaign()
{
$this->caller->publishAffiliatePartnerCampaign(1, []);
$this->assertPreviousRequest('POST', 'affiliate_partner/'.self::TEST_API_VERSION.'/campaigns/1/publish');
}

public function testGenerateAffiliatePartnerCampaignProductLink()
{
$this->caller->generateAffiliatePartnerCampaignProductLink(1, 2, [], []);
$this->assertPreviousRequest('POST', 'affiliate_partner/'.self::TEST_API_VERSION.'/campaigns/1/products/2/promotion_link/generate');
}
}
Loading