You are here

public function CommerceMessageAdminOrderNotificationTest::testOrderNotificationMessageCreation in Commerce Message 7

Tests that the notification is generated on checkout complete.

File

./commerce_message.test, line 374

Class

CommerceMessageAdminOrderNotificationTest
Class CommerceMessageAdminOrderNotificationTest

Code

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