You are here

public function CommerceMessageOrderHistoryTest::testOrderHistoryUi in Commerce Message 7

Test order history UI.

File

./commerce_message.test, line 146

Class

CommerceMessageOrderHistoryTest
Class CommerceMessageOrderHistoryTest

Code

public function testOrderHistoryUi() {
  $order = $this
    ->createDummyOrder();
  commerce_order_status_update($order, 'pending');
  commerce_order_status_update($order, 'completed');
  RulesLog::logger()
    ->checkLog();
  $this
    ->drupalLogin($this->store_admin);
  $this
    ->drupalGet('admin/commerce/orders/' . $order->order_id . '/history');
  $this
    ->assertText('Order has been created.');
  $this
    ->assertText('Product PROD-01 added to the cart.');
  $this
    ->assertText('Status has been set to Pending (previously: Shopping cart).');
  $this
    ->assertText('Status has been set to Completed (previously: Pending).');
  $this
    ->drupalLogout();
  $this
    ->drupalGet('admin/commerce/orders/' . $order->order_id . '/history');
  $this
    ->assertResponse(403, 'Anonymoous users cannot view order history.');
}