OrderNoStoreTest.php in Commerce Core 8.2
File
modules/order/tests/src/Functional/OrderNoStoreTest.php
View source
<?php
namespace Drupal\Tests\commerce_order\Functional;
use Drupal\Core\Url;
use Drupal\Tests\commerce\Functional\CommerceBrowserTestBase;
class OrderNoStoreTest extends CommerceBrowserTestBase {
public static $modules = [
'commerce_order',
];
protected function getAdministratorPermissions() {
return array_merge([
'administer commerce_order',
'administer commerce_order_type',
'access commerce_order overview',
], parent::getAdministratorPermissions());
}
public function testCreateOrder() {
$this->store
->delete();
$this
->drupalGet('admin/commerce/orders');
$this
->clickLink('Create a new order');
$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());
}
}