You are here

public function MailchimpEcommerceTest::testGetVariants in Mailchimp 8

Test getting all variants for a single product.

File

lib/mailchimp-api-php/tests/MailchimpEcommerceTest.php, line 716

Class

MailchimpEcommerceTest
Mailchimp Ecommerce test library.

Namespace

Mailchimp\Tests

Code

public function testGetVariants() {
  $store_id = 'MC001';
  $product_id = 'sku0001';
  $mc = new MailchimpEcommerce();
  $mc
    ->getProductVariants($store_id, $product_id);

  // Check method.
  $this
    ->assertEquals('GET', $mc
    ->getClient()->method);

  // Check URI being used.
  $this
    ->assertEquals($mc
    ->getEndpoint() . '/ecommerce/stores/' . $store_id . '/products/' . $product_id . '/variants', $mc
    ->getClient()->uri);
}