function it_throws_an_exception_if_a_product_exists_when_it_should_not(SharedStorageInterface $sharedStorage, IndexPageInterface $adminProductIndexPage, ProductInterface $product) { $sharedStorage->get('product')->willReturn($product); $adminProductIndexPage->open()->shouldBeCalled(); $adminProductIndexPage->isThereProduct($product)->willReturn(true); $this->shouldThrow(NotEqualException::class)->during('productShouldNotExist', [$product]); }
/** * @Then /^(this product) should not exist in the product catalog$/ */ public function productShouldNotExist(ProductInterface $product) { $this->adminProductIndexPage->open(); expect($this->adminProductIndexPage->isThereProduct($product))->toBe(false); }