/**
  * @Then /^there should be no variants of (this product) in the product catalog$/
  */
 public function thereAreNoVariants(ProductInterface $product)
 {
     $variants = $this->productVariantRepository->findBy(['object' => $product]);
     Assert::same($variants, []);
 }
Exemple #2
0
 /**
  * @Then /^there should be no variants of (this product) in the product catalog$/
  */
 public function thereAreNoVariants(ProductInterface $product)
 {
     expect($this->productVariantRepository->findBy(['object' => $product]))->toBe([]);
 }
 function it_throws_an_exception_if_variants_of_the_product_still_exist(SharedStorageInterface $sharedStorage, ProductVariantRepositoryInterface $productVariantRepository, ProductInterface $product, VariantInterface $variant)
 {
     $sharedStorage->get('deleted_product')->willReturn($product);
     $productVariantRepository->findBy(['object' => $product])->willReturn([$variant]);
     $this->shouldThrow(FailureException::class)->during('thereAreNoVariants', [$product]);
 }