/** * @Then I should not be able to access product :product */ public function iShouldNotBeAbleToAccessProduct(ProductInterface $product) { $this->productShowPage->tryToOpen(['product' => $product]); expect($this->productShowPage->isOpen(['product' => $product]))->toBe(false); }
/** * @Then I should be on :product product detailed page * @Then I should still be on product :product page */ public function iShouldBeOnProductDetailedPage(ProductInterface $product) { Assert::true($this->showPage->isOpen(['slug' => $product->getSlug()]), sprintf('Product %s show page should be open, but it does not.', $product->getName())); }
function it_throws_an_exception_if_i_am_able_to_access_product_page_when_i_should_not(ShowPageInterface $productShowPage, ProductInterface $product) { $productShowPage->tryToOpen(['product' => $product])->shouldBeCalled(); $productShowPage->isOpen(['product' => $product])->willReturn(true); $this->shouldThrow(NotEqualException::class)->during('iShouldNotBeAbleToAccessProduct', [$product]); }