You are here

public function CommerceMessageOrderNotificationTest::testOrderNotificationMessageCreation in Commerce Message 7

Tests that the notification is generated on checkout complete.

File

./commerce_message.test, line 266

Class

CommerceMessageOrderNotificationTest
Class CommerceMessageOrderNotificationTest

Code

public function testOrderNotificationMessageCreation() {
  $order = $this
    ->createDummyOrder();
  commerce_checkout_complete($order);
  $messages = $this
    ->loadMessagesForOrder($order);
  foreach ($messages as $message) {
    if ($message
      ->bundle() == 'commerce_order_order_confirmation') {
      $this
        ->pass('Order that completed checkout had an order notification generated.');
    }
  }
  $this
    ->assertNotNull(self::$sent_message);
}