You are here

public function OrderNoStoreTest::testCreateOrder in Commerce Core 8.2

Tests creating an order.

File

modules/order/tests/src/Functional/OrderNoStoreTest.php, line 36

Class

OrderNoStoreTest
Tests order UI behavior when there are no stores.

Namespace

Drupal\Tests\commerce_order\Functional

Code

public function testCreateOrder() {
  $this->store
    ->delete();
  $this
    ->drupalGet('admin/commerce/orders');
  $this
    ->clickLink('Create a new order');

  // Check that the warning is present.
  $session = $this
    ->assertSession();
  $session
    ->pageTextContains("Orders can't be created until a store has been added.");
  $session
    ->linkExists('Add a new store.');
  $session
    ->linkByHrefExists(Url::fromRoute('entity.commerce_store.add_page')
    ->toString());
}