You are here

public function MailchimpEcommerceTest::testUpdateStore in Mailchimp 8

Tests library functionality for updating a store.

File

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

Class

MailchimpEcommerceTest
Mailchimp Ecommerce test library.

Namespace

Mailchimp\Tests

Code

public function testUpdateStore() {
  $store_id = 'MC001';
  $name = "Freddie's Merchandise";
  $currency_code = 'USD';
  $mc = new MailchimpEcommerce();
  $mc
    ->updateStore($store_id, $name, $currency_code);
  $this
    ->assertEquals('PATCH', $mc
    ->getClient()->method);
  $this
    ->assertEquals($mc
    ->getEndpoint() . '/ecommerce/stores/' . $store_id, $mc
    ->getClient()->uri);
  $this
    ->assertNotEmpty($mc
    ->getClient()->options['json']);
  $request_body = $mc
    ->getClient()->options['json'];
  $this
    ->assertEquals($name, $request_body->name);
  $this
    ->assertEquals($currency_code, $request_body->currency_code);
}