/** * @Then /^it should have (\d+) items$/ */ public function itShouldHaveAmountOfItems($amount) { $itemsCount = $this->showPage->countItems(); Assert::eq($amount, $itemsCount, sprintf('There should be %d items, but get %d.', $amount, $itemsCount)); }