/** * @Then /^average rating of (product "[^"]+") should be (\d+)$/ */ public function thisProductAverageRatingShouldBe(ProductInterface $product, $averageRating) { $this->showPage->tryToOpen(['slug' => $product->getSlug()]); $this->iShouldSeeAsItsAverageRating($averageRating); }
/** * @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 not be able to access product :product */ public function iShouldNotBeAbleToAccessProduct(ProductInterface $product) { $this->showPage->tryToOpen(['slug' => $product->getSlug()]); Assert::false($this->showPage->isOpen(['slug' => $product->getSlug()]), 'Product show page should not be open, but it does.'); }
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]); }