public function FeatureContext::assertEditProductOfType in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
Asserts that a given commerce_product type is editable.
@Then /^I should be able to edit (?:a|an) "([^"]*)" product$/
File
- test/
features/ bootstrap/ FeatureContext.php, line 790
Class
- FeatureContext
- Features context.
Code
public function assertEditProductOfType($type) {
$product = commerce_product_new($type);
$random = new Random();
$product->title = $random
->name();
$product->sku = $random
->name();
commerce_product_save($product);
$this->products[] = $product;
// Set internal browser on the node edit page.
$this
->getSession()
->visit($this
->locatePath('/admin/commerce/products/' . $product->product_id . '/edit'));
}