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]);
 }
 /**
  * @Given product with :element :value should not be added
  */
 public function productWithNameShouldNotBeAdded($element, $value)
 {
     $this->iWantToBrowseProducts();
     Assert::false($this->indexPage->isSingleResourceOnPage([$element => $value]), sprintf('Product with %s %s was created, but it should not.', $element, $value));
 }
Exemple #3
0
 /**
  * @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);
 }