public function ProductNoStoreTest::testCreateProduct in Commerce Core 8.2
Tests creating a product.
File
- modules/
product/ tests/ src/ Functional/ ProductNoStoreTest.php, line 36
Class
- ProductNoStoreTest
- Tests product UI behavior when there are no stores.
Namespace
Drupal\Tests\commerce_product\FunctionalCode
public function testCreateProduct() {
$this->store
->delete();
$this
->drupalGet('admin/commerce/products');
$this
->clickLink('Add product');
// Check that the warning is present.
$session = $this
->assertSession();
$session
->pageTextContains("Products 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());
}