예제 #1
0
 /**
  * @Then /^average rating of (product "[^"]+") should be (\d+)$/
  */
 public function thisProductAverageRatingShouldBe(ProductInterface $product, $averageRating)
 {
     $this->showPage->tryToOpen(['slug' => $product->getSlug()]);
     $this->iShouldSeeAsItsAverageRating($averageRating);
 }
예제 #2
0
 /**
  * @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);
 }
예제 #3
0
 /**
  * @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.');
 }
예제 #4
0
 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]);
 }