You are here

public function MailchimpEcommerceTest::testGetProduct in Mailchimp 8

Test getting information on a single product.

File

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

Class

MailchimpEcommerceTest
Mailchimp Ecommerce test library.

Namespace

Mailchimp\Tests

Code

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

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

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