PHP Class spec\Sylius\Bundle\ProductBundle\Validator\UniqueSimpleProductCodeValidatorSpec

Inheritance: extends PhpSpec\ObjectBehavior
Show file Open project: sylius/sylius

Public Methods

Method Description
it_add_violation_if_product_is_simple_and_code_has_been_used_in_other_product_variant ( Symfony\Component\Validator\Context\ExecutionContextInterface $context, Sylius\Component\Product\Model\ProductInterface $product, Sylius\Component\Product\Model\ProductVariantInterface $existingProductVariant, Sylius\Component\Product\Repository\ProductVariantRepositoryInterface $productVariantRepository, Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface $constraintViolationBuilder )
it_does_not_add_violation_if_product_is_configurable ( Symfony\Component\Validator\Context\ExecutionContextInterface $context, Sylius\Component\Product\Model\ProductInterface $product )
it_does_not_add_violation_if_product_is_simple_but_code_has_not_been_used_among_neither_producs_nor_product_variants ( Symfony\Component\Validator\Context\ExecutionContextInterface $context, Sylius\Component\Product\Model\ProductInterface $product, Sylius\Component\Product\Repository\ProductVariantRepositoryInterface $productVariantRepository )
it_is_a_constraint_validator ( )
it_is_initializable ( )
let ( Symfony\Component\Validator\Context\ExecutionContextInterface $context, Sylius\Component\Product\Repository\ProductVariantRepositoryInterface $productVariantRepository )

Method Details

it_add_violation_if_product_is_simple_and_code_has_been_used_in_other_product_variant() public method

public it_add_violation_if_product_is_simple_and_code_has_been_used_in_other_product_variant ( Symfony\Component\Validator\Context\ExecutionContextInterface $context, Sylius\Component\Product\Model\ProductInterface $product, Sylius\Component\Product\Model\ProductVariantInterface $existingProductVariant, Sylius\Component\Product\Repository\ProductVariantRepositoryInterface $productVariantRepository, Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface $constraintViolationBuilder )
$context Symfony\Component\Validator\Context\ExecutionContextInterface
$product Sylius\Component\Product\Model\ProductInterface
$existingProductVariant Sylius\Component\Product\Model\ProductVariantInterface
$productVariantRepository Sylius\Component\Product\Repository\ProductVariantRepositoryInterface
$constraintViolationBuilder Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface

it_does_not_add_violation_if_product_is_configurable() public method

public it_does_not_add_violation_if_product_is_configurable ( Symfony\Component\Validator\Context\ExecutionContextInterface $context, Sylius\Component\Product\Model\ProductInterface $product )
$context Symfony\Component\Validator\Context\ExecutionContextInterface
$product Sylius\Component\Product\Model\ProductInterface

it_does_not_add_violation_if_product_is_simple_but_code_has_not_been_used_among_neither_producs_nor_product_variants() public method

public it_does_not_add_violation_if_product_is_simple_but_code_has_not_been_used_among_neither_producs_nor_product_variants ( Symfony\Component\Validator\Context\ExecutionContextInterface $context, Sylius\Component\Product\Model\ProductInterface $product, Sylius\Component\Product\Repository\ProductVariantRepositoryInterface $productVariantRepository )
$context Symfony\Component\Validator\Context\ExecutionContextInterface
$product Sylius\Component\Product\Model\ProductInterface
$productVariantRepository Sylius\Component\Product\Repository\ProductVariantRepositoryInterface

it_is_a_constraint_validator() public method

it_is_initializable() public method

public it_is_initializable ( )

let() public method

public let ( Symfony\Component\Validator\Context\ExecutionContextInterface $context, Sylius\Component\Product\Repository\ProductVariantRepositoryInterface $productVariantRepository )
$context Symfony\Component\Validator\Context\ExecutionContextInterface
$productVariantRepository Sylius\Component\Product\Repository\ProductVariantRepositoryInterface