You are here

public function MailchimpEcommerceTestCase::testAddOrderNoLineItems in Mailchimp E-Commerce 7

Tests adding an order to Mailchimp with no line items.

File

tests/mailchimp_ecommerce.test, line 136
Test class and methods for the Mailchimp eCommerce module.

Class

MailchimpEcommerceTestCase
Tests for Mailchimp eCommerce core integration.

Code

public function testAddOrderNoLineItems() {
  $store_id = 1;
  $order_id = 1;
  $customer = [
    'id' => 1,
    'email_address' => 'testuser@example.com',
    'first_name' => 'Test',
    'last_name' => 'User',
  ];
  $order = [
    'currency_code' => 'USD',
    'order_total' => 19.99,
  ];
  mailchimp_ecommerce_add_order($order_id, $customer, $order);

  /* @var \Mailchimp\MailchimpEcommerce $mc_ecommerce */
  $mc_ecommerce = mailchimp_get_api_object('MailchimpEcommerce');
  $saved_order = $mc_ecommerce
    ->getOrder($store_id, $order_id);
  $this
    ->assertNull($saved_order);
}