You are here

public function MailchimpEcommerceTest::testDeleteVariant in Mailchimp 8

Test deleting a variant.

File

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

Class

MailchimpEcommerceTest
Mailchimp Ecommerce test library.

Namespace

Mailchimp\Tests

Code

public function testDeleteVariant() {
  $store_id = 'MC001';
  $product_id = 'sku0001';
  $variant_id = 'var001';
  $mc = new MailchimpEcommerce();
  $mc
    ->deleteProductVariant($store_id, $product_id, $variant_id);

  // Confirm we are using DELETE in the client method.
  $this
    ->assertEquals('DELETE', $mc
    ->getClient()->method);

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