Fix Behat steps

This commit is contained in:
michalmarcinkowski 2017-01-19 16:13:43 +01:00
parent 8e8695692f
commit 98c79b4536
2 changed files with 24 additions and 6 deletions

View file

@ -9,12 +9,12 @@ Feature: Filtering orders by total in different currencies
And the store operates on a channel named "Web-UK" in "GBP" currency
And the store has "Apple T-Shirt", "Pineapple T-Shirt" and "Pen T-Shirt" products
And the store has customer "John Hancock" with email "hancock@superheronope.com"
And this customer has placed an order "#00000001" buying a single "Apple T-Shirt" product for "$100" in "US Dollar" currency
And this customer has also placed an order "#00000002" buying a single "Pineapple T-Shirt" product for "$200" in "US Dollar" currency
And this customer has also placed an order "#00000003" buying a single "Pen T-Shirt" product for "$150.50" in "US Dollar" currency
And this customer has also placed an order "#00000004" buying a single "Apple T-Shirt" product for "£200" in "British Pound" currency
And this customer has also placed an order "#00000005" buying a single "Pineapple T-Shirt" product for "£150.50" in "British Pound" currency
And this customer has also placed an order "#00000006" buying a single "Pen T-Shirt" product for "£100" in "British Pound" currency
And this customer has placed an order "#00000001" buying a single "Apple T-Shirt" product for "$100" on the "Web-US" channel
And this customer has also placed an order "#00000002" buying a single "Pineapple T-Shirt" product for "$200" on the "Web-US" channel
And this customer has also placed an order "#00000003" buying a single "Pen T-Shirt" product for "$150.50" on the "Web-US" channel
And this customer has also placed an order "#00000004" buying a single "Apple T-Shirt" product for "£200" on the "Web-UK" channel
And this customer has also placed an order "#00000005" buying a single "Pineapple T-Shirt" product for "£150.50" on the "Web-UK" channel
And this customer has also placed an order "#00000006" buying a single "Pen T-Shirt" product for "£100" on the "Web-UK" channel
And I am logged in as an administrator
And I am browsing orders

View file

@ -528,6 +528,24 @@ final class OrderContext implements Context
$this->objectManager->flush();
}
/**
* @Given /^(this customer) has(?:| also) placed (an order "[^"]+") buying a single ("[^"]+" product) for ("[^"]+") on the ("[^"]+" channel)$/
*/
public function customerHasPlacedAnOrderBuyingASingleProductForOnTheChannel(
CustomerInterface $customer,
$orderNumber,
ProductInterface $product,
$price,
ChannelInterface $channel
) {
$order = $this->createOrder($customer, $orderNumber, $channel);
$order->setState(OrderInterface::STATE_NEW);
$this->addVariantWithPriceToOrder($order, $product->getVariants()->first(), $price);
$this->orderRepository->add($order);
}
/**
* @Given /^(this order) is already paid$/
* @Given the order :order is already paid