PHP Class spec\Sylius\Bundle\CoreBundle\Validator\Constraints\CartItemAvailabilityValidatorSpec

Author: Arkadiusz Krakowiak ([email protected])
Inheritance: extends PhpSpec\ObjectBehavior
Show file Open project: sylius/sylius

Public Methods

Method Description
it_adds_violation_if_requested_cart_item_is_not_available ( Symfony\Component\Validator\Context\ExecutionContextInterface $executionContext, Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface $availabilityChecker, Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface $addCartItemCommand, Sylius\Component\Core\Model\OrderInterface $order, Sylius\Component\Core\Model\OrderItemInterface $orderItem, Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
it_adds_violation_if_total_quantity_of_cart_items_exceed_available_quantity ( Symfony\Component\Validator\Context\ExecutionContextInterface $executionContext, Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface $availabilityChecker, Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface $addCartItemCommand, Sylius\Component\Core\Model\OrderInterface $order, Sylius\Component\Core\Model\OrderItemInterface $orderItem, Sylius\Component\Core\Model\OrderItemInterface $existingOrderItem, Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
it_does_not_add_violation_if_requested_cart_item_is_available ( Symfony\Component\Validator\Context\ExecutionContextInterface $executionContext, Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface $availabilityChecker, Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface $addCartItemCommand, Sylius\Component\Core\Model\OrderInterface $order, Sylius\Component\Core\Model\OrderItemInterface $orderItem, Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
it_does_not_add_violation_if_total_quantity_of_cart_items_do_not_exceed_available_quantity ( Symfony\Component\Validator\Context\ExecutionContextInterface $executionContext, Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface $availabilityChecker, Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface $addCartItemCommand, Sylius\Component\Core\Model\OrderInterface $order, Sylius\Component\Core\Model\OrderItemInterface $orderItem, Sylius\Component\Core\Model\OrderItemInterface $existingOrderItem, Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
it_is_cart_item_availability_validator ( Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface $addCartItemCommand )
it_is_constraint_validator ( )
it_is_initializable ( )
it_validates_only_add_cart_item_commands ( Sylius\Component\Core\Model\OrderInterface $order )
let ( Symfony\Component\Validator\Context\ExecutionContextInterface $executionContext, Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface $availabilityChecker )

Method Details

it_adds_violation_if_requested_cart_item_is_not_available() public method

public it_adds_violation_if_requested_cart_item_is_not_available ( Symfony\Component\Validator\Context\ExecutionContextInterface $executionContext, Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface $availabilityChecker, Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface $addCartItemCommand, Sylius\Component\Core\Model\OrderInterface $order, Sylius\Component\Core\Model\OrderItemInterface $orderItem, Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
$executionContext Symfony\Component\Validator\Context\ExecutionContextInterface
$availabilityChecker Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface
$addCartItemCommand Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface
$order Sylius\Component\Core\Model\OrderInterface
$orderItem Sylius\Component\Core\Model\OrderItemInterface
$productVariant Sylius\Component\Core\Model\ProductVariantInterface

it_adds_violation_if_total_quantity_of_cart_items_exceed_available_quantity() public method

public it_adds_violation_if_total_quantity_of_cart_items_exceed_available_quantity ( Symfony\Component\Validator\Context\ExecutionContextInterface $executionContext, Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface $availabilityChecker, Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface $addCartItemCommand, Sylius\Component\Core\Model\OrderInterface $order, Sylius\Component\Core\Model\OrderItemInterface $orderItem, Sylius\Component\Core\Model\OrderItemInterface $existingOrderItem, Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
$executionContext Symfony\Component\Validator\Context\ExecutionContextInterface
$availabilityChecker Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface
$addCartItemCommand Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface
$order Sylius\Component\Core\Model\OrderInterface
$orderItem Sylius\Component\Core\Model\OrderItemInterface
$existingOrderItem Sylius\Component\Core\Model\OrderItemInterface
$productVariant Sylius\Component\Core\Model\ProductVariantInterface

it_does_not_add_violation_if_requested_cart_item_is_available() public method

public it_does_not_add_violation_if_requested_cart_item_is_available ( Symfony\Component\Validator\Context\ExecutionContextInterface $executionContext, Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface $availabilityChecker, Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface $addCartItemCommand, Sylius\Component\Core\Model\OrderInterface $order, Sylius\Component\Core\Model\OrderItemInterface $orderItem, Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
$executionContext Symfony\Component\Validator\Context\ExecutionContextInterface
$availabilityChecker Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface
$addCartItemCommand Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface
$order Sylius\Component\Core\Model\OrderInterface
$orderItem Sylius\Component\Core\Model\OrderItemInterface
$productVariant Sylius\Component\Core\Model\ProductVariantInterface

it_does_not_add_violation_if_total_quantity_of_cart_items_do_not_exceed_available_quantity() public method

public it_does_not_add_violation_if_total_quantity_of_cart_items_do_not_exceed_available_quantity ( Symfony\Component\Validator\Context\ExecutionContextInterface $executionContext, Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface $availabilityChecker, Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface $addCartItemCommand, Sylius\Component\Core\Model\OrderInterface $order, Sylius\Component\Core\Model\OrderItemInterface $orderItem, Sylius\Component\Core\Model\OrderItemInterface $existingOrderItem, Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
$executionContext Symfony\Component\Validator\Context\ExecutionContextInterface
$availabilityChecker Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface
$addCartItemCommand Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface
$order Sylius\Component\Core\Model\OrderInterface
$orderItem Sylius\Component\Core\Model\OrderItemInterface
$existingOrderItem Sylius\Component\Core\Model\OrderItemInterface
$productVariant Sylius\Component\Core\Model\ProductVariantInterface

it_is_cart_item_availability_validator() public method

public it_is_cart_item_availability_validator ( Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface $addCartItemCommand )
$addCartItemCommand Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface

it_is_constraint_validator() public method

it_is_initializable() public method

public it_is_initializable ( )

it_validates_only_add_cart_item_commands() public method

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

let() public method

public let ( Symfony\Component\Validator\Context\ExecutionContextInterface $executionContext, Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface $availabilityChecker )
$executionContext Symfony\Component\Validator\Context\ExecutionContextInterface
$availabilityChecker Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface