/** * @Then /^(this variant) should still exist in the product catalog$/ */ public function productVariantShouldExistInTheProductCatalog(ProductVariantInterface $productVariant) { $productVariant = $this->productVariantRepository->find($productVariant->getId()); expect($productVariant)->toNotBe(null); }
/** * @Then /^(this variant) should still exist in the product catalog$/ */ public function productVariantShouldExistInTheProductCatalog(ProductVariantInterface $productVariant) { $productVariant = $this->productVariantRepository->find($productVariant->getId()); Assert::notNull($productVariant); }
/** * @Then this variant should still exist in the product catalog */ public function productVariantShouldExistInTheProductCatalog() { $productVariantId = $this->sharedStorage->get('product_variant_id'); $productVariant = $this->productVariantRepository->find($productVariantId); Assert::notNull($productVariant); }
function it_throws_an_exception_if_a_product_variant_does_not_exist(ProductVariantRepositoryInterface $productVariantRepository, ProductVariantInterface $productVariant) { $productVariant->getId()->willReturn(1); $productVariantRepository->find(1)->willReturn(null); $this->shouldThrow(FailureException::class)->during('productVariantShouldExistInTheProductCatalog', [$productVariant]); }