You are here

public function CommerceOrderUIAdminTest::testCommerceOrderUIViewOrderUser in Commerce Core 7

Test if the owner of the order can see it correctly.

File

modules/order/tests/commerce_order_ui.test, line 284
Functional tests for the commerce order UI module.

Class

CommerceOrderUIAdminTest
Functional tests for the commerce order UI module.

Code

public function testCommerceOrderUIViewOrderUser() {

  // Log in as a normal user.
  $this
    ->drupalLogin($this->store_customer);

  // Access the order profile menu page.
  $this
    ->drupalGet('user/' . $this->store_customer->uid . '/orders');
  $this
    ->assertResponse(200, t('Users can access to their own orders listing'));

  // Access the order just created for the user.
  $this
    ->drupalGet('user/' . $this->store_customer->uid . '/orders/' . $this->order->order_id);
  $this
    ->assertResponse(200, t('Users can access their own order details'));
  $this
    ->assertTitle(t('Order @number', array(
    '@number' => $this->order->order_number,
  )) . ' | Drupal', t('The order number accessed by the user matches the order from URL'));
}