/** * @Given /^(product "[^"]+") price should not be decreased$/ */ public function productPriceShouldNotBeDecreased(ProductInterface $product) { $this->cartSummaryPage->open(); expect($this->cartSummaryPage->isItemDiscounted($product->getName()))->toBe(false); }
function it_throws_exception_if_discount_price_is_present_on_the_page_but_should_not(CartSummaryPageInterface $cartSummaryPage, ProductInterface $product) { $cartSummaryPage->open()->shouldBeCalled(); $product->getName()->willReturn('Test product'); $cartSummaryPage->isItemDiscounted('Test product')->willReturn(true); $this->shouldThrow(new FailureException('Expected <value>false</value>, but got <value>true</value>.'))->during('productPriceShouldNotBeDecreased', [$product]); }