/** * @Then the last promotion on the list should have :field :value */ public function theLastPromotionOnTheListShouldHave($field, $value) { $fields = $this->indexPage->getColumnFields($field); $actualValue = end($fields); Assert::same($actualValue, $value, sprintf('Expected last promotion\'s %s to be "%s", but it is "%s".', $field, $value, $actualValue)); }
/** * @Then the promotion :promotion should be used :usage time(s) */ public function thePromotionShouldBeUsedTime(PromotionInterface $promotion, $usage) { Assert::same((int) $usage, $this->indexPage->getUsageNumber($promotion), 'Promotion should be used %s times, but is %2$s.'); }
/** * @Then /^(this promotion) should no longer exist in the promotion registry$/ */ public function promotionShouldNotExistInTheRegistry(PromotionInterface $promotion) { $this->indexPage->open(); Assert::false($this->indexPage->isSingleResourceOnPage(['code' => $promotion->getCode()]), sprintf('Promotion with code %s exists but should not.', $promotion->getCode())); }