PHP Class Sylius\Behat\Context\Setup\OrderContext

Author: Łukasz Chruściel ([email protected])
Inheritance: implements Behat\Behat\Context\Context
Show file Open project: sylius/sylius

Public Methods

Method Description
__construct ( Sylius\Behat\Service\SharedStorageInterface $sharedStorage, Sylius\Component\Core\Repository\OrderRepositoryInterface $orderRepository, Sylius\Component\Resource\Factory\FactoryInterface $orderFactory, Sylius\Component\Order\Processor\OrderProcessorInterface $orderProcessor, Sylius\Component\Resource\Factory\FactoryInterface $orderItemFactory, Sylius\Component\Order\Modifier\OrderItemQuantityModifierInterface $itemQuantityModifier, Sylius\Component\Resource\Repository\RepositoryInterface $currencyRepository, Sylius\Component\Core\Currency\CurrencyStorageInterface $currencyStorage, Sylius\Component\Resource\Factory\FactoryInterface $customerFactory, Sylius\Component\Resource\Repository\RepositoryInterface $customerRepository, Doctrine\Common\Persistence\ObjectManager $objectManager, SM\Factory\FactoryInterface $stateMachineFactory, Sylius\Component\Product\Resolver\ProductVariantResolverInterface $variantResolver )
customerStartedCheckout ( Sylius\Component\Customer\Model\CustomerInterface $customer )
customersHaveAddedProductsToTheCartForTotalOf ( $numberOfCustomers, $total )
customersHavePlacedOrdersForTotalOf ( $numberOfCustomers, $numberOfOrders, $total )
customersHavePlacedOrdersForTotalOfMostlyProduct ( $numberOfCustomers, $numberOfOrders, $total, Sylius\Component\Core\Model\ProductInterface $product )
forTheBillingAddressOf ( Sylius\Component\Core\Model\AddressInterface $address )
iHaveAlreadyPlacedOrderNthTimes ( Sylius\Component\User\Model\UserInterface $user, $numberOfOrders, Sylius\Component\Core\Model\ShippingMethodInterface $shippingMethod, Sylius\Component\Core\Model\AddressInterface $address, Sylius\Component\Payment\Model\PaymentMethodInterface $paymentMethod )
iPlacedAnOrder ( Sylius\Component\User\Model\UserInterface $user, $orderNumber )
iUsedCoupon ( Sylius\Component\Core\Model\PromotionCouponInterface $coupon )
theCustomerAddressedItTo ( Sylius\Component\Core\Model\AddressInterface $address )
theCustomerAddressedItToWithIdenticalBillingAddress ( Sylius\Component\Core\Model\AddressInterface $address )
theCustomerBoughtProductAndProduct ( Sylius\Component\Core\Model\ProductInterface $product, Sylius\Component\Core\Model\ProductInterface $secondProduct )
theCustomerBoughtSeveralProducts ( $quantity, Sylius\Component\Core\Model\ProductInterface $product )
theCustomerBoughtSeveralVariantsOfProduct ( $quantity, Sylius\Component\Core\Model\ProductVariantInterface $variant )
theCustomerBoughtSingleProduct ( Sylius\Component\Core\Model\ProductInterface $product )
theCustomerBoughtSingleProductVariant ( Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
theCustomerBoughtSingleUsing ( Sylius\Component\Core\Model\ProductInterface $product, Sylius\Component\Core\Model\PromotionCouponInterface $coupon )
theCustomerCancelledMyLastOrder ( )
theCustomerCancelledThisOrder ( Sylius\Component\Core\Model\OrderInterface $order )
theCustomerChoseShippingToWithPayment ( Sylius\Component\Core\Model\ShippingMethodInterface $shippingMethod, Sylius\Component\Core\Model\AddressInterface $address, Sylius\Component\Payment\Model\PaymentMethodInterface $paymentMethod )
theCustomerChoseShippingWithPayment ( Sylius\Component\Core\Model\ShippingMethodInterface $shippingMethod, Sylius\Component\Payment\Model\PaymentMethodInterface $paymentMethod )
thereIsCustomerThatPlacedOrder ( Sylius\Component\Customer\Model\CustomerInterface $customer, $orderNumber = null )
thisOrderHasAlreadyBeenShipped ( Sylius\Component\Core\Model\OrderInterface $order )
thisOrderIsAlreadyPaid ( Sylius\Component\Core\Model\OrderInterface $order )

Private Methods

Method Description
addProductVariantToOrder ( Sylius\Component\Core\Model\ProductVariantInterface $productVariant, integer $quantity = 1 ) : Sylius\Component\Core\Model\OrderInterface
applyPaymentTransitionOnOrder ( Sylius\Component\Core\Model\OrderInterface $order, string $transition )
applyShipmentTransitionOnOrder ( Sylius\Component\Core\Model\OrderInterface $order, string $transition )
applyTransitionOnOrderCheckout ( Sylius\Component\Core\Model\OrderInterface $order, string $transition )
checkoutUsing ( Sylius\Component\Core\Model\OrderInterface $order, Sylius\Component\Core\Model\ShippingMethodInterface $shippingMethod, Sylius\Component\Core\Model\AddressInterface $address, Sylius\Component\Payment\Model\PaymentMethodInterface $paymentMethod )
createCart ( Sylius\Component\Customer\Model\CustomerInterface $customer, Sylius\Component\Core\Model\ChannelInterface $channel = null, string | null $currencyCode = null, string | null $localeCode = null ) : Sylius\Component\Core\Model\OrderInterface
createOrder ( Sylius\Component\Customer\Model\CustomerInterface $customer, string $number = null, Sylius\Component\Core\Model\ChannelInterface $channel = null, string | null $currencyCode = null, string | null $localeCode = null ) : Sylius\Component\Core\Model\OrderInterface
generateCustomers ( integer $count ) : Sylius\Component\Customer\Model\CustomerInterface[]
getPriceFromString ( string $price ) : integer
proceedSelectingShippingAndPaymentMethod ( Sylius\Component\Core\Model\OrderInterface $order, Sylius\Component\Core\Model\ShippingMethodInterface $shippingMethod, Sylius\Component\Payment\Model\PaymentMethodInterface $paymentMethod )

Method Details

__construct() public method

public __construct ( Sylius\Behat\Service\SharedStorageInterface $sharedStorage, Sylius\Component\Core\Repository\OrderRepositoryInterface $orderRepository, Sylius\Component\Resource\Factory\FactoryInterface $orderFactory, Sylius\Component\Order\Processor\OrderProcessorInterface $orderProcessor, Sylius\Component\Resource\Factory\FactoryInterface $orderItemFactory, Sylius\Component\Order\Modifier\OrderItemQuantityModifierInterface $itemQuantityModifier, Sylius\Component\Resource\Repository\RepositoryInterface $currencyRepository, Sylius\Component\Core\Currency\CurrencyStorageInterface $currencyStorage, Sylius\Component\Resource\Factory\FactoryInterface $customerFactory, Sylius\Component\Resource\Repository\RepositoryInterface $customerRepository, Doctrine\Common\Persistence\ObjectManager $objectManager, SM\Factory\FactoryInterface $stateMachineFactory, Sylius\Component\Product\Resolver\ProductVariantResolverInterface $variantResolver )
$sharedStorage Sylius\Behat\Service\SharedStorageInterface
$orderRepository Sylius\Component\Core\Repository\OrderRepositoryInterface
$orderFactory Sylius\Component\Resource\Factory\FactoryInterface
$orderProcessor Sylius\Component\Order\Processor\OrderProcessorInterface
$orderItemFactory Sylius\Component\Resource\Factory\FactoryInterface
$itemQuantityModifier Sylius\Component\Order\Modifier\OrderItemQuantityModifierInterface
$currencyRepository Sylius\Component\Resource\Repository\RepositoryInterface
$currencyStorage Sylius\Component\Core\Currency\CurrencyStorageInterface
$customerFactory Sylius\Component\Resource\Factory\FactoryInterface
$customerRepository Sylius\Component\Resource\Repository\RepositoryInterface
$objectManager Doctrine\Common\Persistence\ObjectManager
$stateMachineFactory SM\Factory\FactoryInterface
$variantResolver Sylius\Component\Product\Resolver\ProductVariantResolverInterface

customerStartedCheckout() public method

public customerStartedCheckout ( Sylius\Component\Customer\Model\CustomerInterface $customer )
$customer Sylius\Component\Customer\Model\CustomerInterface

customersHaveAddedProductsToTheCartForTotalOf() public method

public customersHaveAddedProductsToTheCartForTotalOf ( $numberOfCustomers, $total )

customersHavePlacedOrdersForTotalOf() public method

public customersHavePlacedOrdersForTotalOf ( $numberOfCustomers, $numberOfOrders, $total )

customersHavePlacedOrdersForTotalOfMostlyProduct() public method

public customersHavePlacedOrdersForTotalOfMostlyProduct ( $numberOfCustomers, $numberOfOrders, $total, Sylius\Component\Core\Model\ProductInterface $product )
$product Sylius\Component\Core\Model\ProductInterface

forTheBillingAddressOf() public method

public forTheBillingAddressOf ( Sylius\Component\Core\Model\AddressInterface $address )
$address Sylius\Component\Core\Model\AddressInterface

iHaveAlreadyPlacedOrderNthTimes() public method

public iHaveAlreadyPlacedOrderNthTimes ( Sylius\Component\User\Model\UserInterface $user, $numberOfOrders, Sylius\Component\Core\Model\ShippingMethodInterface $shippingMethod, Sylius\Component\Core\Model\AddressInterface $address, Sylius\Component\Payment\Model\PaymentMethodInterface $paymentMethod )
$user Sylius\Component\User\Model\UserInterface
$shippingMethod Sylius\Component\Core\Model\ShippingMethodInterface
$address Sylius\Component\Core\Model\AddressInterface
$paymentMethod Sylius\Component\Payment\Model\PaymentMethodInterface

iPlacedAnOrder() public method

public iPlacedAnOrder ( Sylius\Component\User\Model\UserInterface $user, $orderNumber )
$user Sylius\Component\User\Model\UserInterface

iUsedCoupon() public method

public iUsedCoupon ( Sylius\Component\Core\Model\PromotionCouponInterface $coupon )
$coupon Sylius\Component\Core\Model\PromotionCouponInterface

theCustomerAddressedItTo() public method

public theCustomerAddressedItTo ( Sylius\Component\Core\Model\AddressInterface $address )
$address Sylius\Component\Core\Model\AddressInterface

theCustomerAddressedItToWithIdenticalBillingAddress() public method

public theCustomerAddressedItToWithIdenticalBillingAddress ( Sylius\Component\Core\Model\AddressInterface $address )
$address Sylius\Component\Core\Model\AddressInterface

theCustomerBoughtProductAndProduct() public method

public theCustomerBoughtProductAndProduct ( Sylius\Component\Core\Model\ProductInterface $product, Sylius\Component\Core\Model\ProductInterface $secondProduct )
$product Sylius\Component\Core\Model\ProductInterface
$secondProduct Sylius\Component\Core\Model\ProductInterface

theCustomerBoughtSeveralProducts() public method

public theCustomerBoughtSeveralProducts ( $quantity, Sylius\Component\Core\Model\ProductInterface $product )
$product Sylius\Component\Core\Model\ProductInterface

theCustomerBoughtSeveralVariantsOfProduct() public method

public theCustomerBoughtSeveralVariantsOfProduct ( $quantity, Sylius\Component\Core\Model\ProductVariantInterface $variant )
$variant Sylius\Component\Core\Model\ProductVariantInterface

theCustomerBoughtSingleProduct() public method

public theCustomerBoughtSingleProduct ( Sylius\Component\Core\Model\ProductInterface $product )
$product Sylius\Component\Core\Model\ProductInterface

theCustomerBoughtSingleProductVariant() public method

public theCustomerBoughtSingleProductVariant ( Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
$productVariant Sylius\Component\Core\Model\ProductVariantInterface

theCustomerBoughtSingleUsing() public method

public theCustomerBoughtSingleUsing ( Sylius\Component\Core\Model\ProductInterface $product, Sylius\Component\Core\Model\PromotionCouponInterface $coupon )
$product Sylius\Component\Core\Model\ProductInterface
$coupon Sylius\Component\Core\Model\PromotionCouponInterface

theCustomerCancelledMyLastOrder() public method

theCustomerCancelledThisOrder() public method

public theCustomerCancelledThisOrder ( Sylius\Component\Core\Model\OrderInterface $order )
$order Sylius\Component\Core\Model\OrderInterface

theCustomerChoseShippingToWithPayment() public method

public theCustomerChoseShippingToWithPayment ( Sylius\Component\Core\Model\ShippingMethodInterface $shippingMethod, Sylius\Component\Core\Model\AddressInterface $address, Sylius\Component\Payment\Model\PaymentMethodInterface $paymentMethod )
$shippingMethod Sylius\Component\Core\Model\ShippingMethodInterface
$address Sylius\Component\Core\Model\AddressInterface
$paymentMethod Sylius\Component\Payment\Model\PaymentMethodInterface

theCustomerChoseShippingWithPayment() public method

public theCustomerChoseShippingWithPayment ( Sylius\Component\Core\Model\ShippingMethodInterface $shippingMethod, Sylius\Component\Payment\Model\PaymentMethodInterface $paymentMethod )
$shippingMethod Sylius\Component\Core\Model\ShippingMethodInterface
$paymentMethod Sylius\Component\Payment\Model\PaymentMethodInterface

thereIsCustomerThatPlacedOrder() public method

public thereIsCustomerThatPlacedOrder ( Sylius\Component\Customer\Model\CustomerInterface $customer, $orderNumber = null )
$customer Sylius\Component\Customer\Model\CustomerInterface

thisOrderHasAlreadyBeenShipped() public method

public thisOrderHasAlreadyBeenShipped ( Sylius\Component\Core\Model\OrderInterface $order )
$order Sylius\Component\Core\Model\OrderInterface

thisOrderIsAlreadyPaid() public method

public thisOrderIsAlreadyPaid ( Sylius\Component\Core\Model\OrderInterface $order )
$order Sylius\Component\Core\Model\OrderInterface