/** * @Then I should be notified that tax category with this code already exists */ public function iShouldBeNotifiedThatTaxCategoryWithThisCodeAlreadyExists() { Assert::true($this->createPage->checkValidationMessageFor('code', 'The tax category with given code already exists.'), 'Unique code violation message should appear on page, but it does not.'); }
/** * @Then I should be notified that tax category with this code already exists */ public function iShouldBeNotifiedThatTaxCategoryWithThisCodeAlreadyExists() { Assert::same($this->createPage->getValidationMessage('code'), 'The tax category with given code already exists.'); }
function it_throws_an_exception_if_the_message_on_a_page_is_not_related_to_unique_code_validation(CreatePageInterface $createPage) { $createPage->checkValidationMessageFor('code', 'The tax category with given code already exists.')->willReturn(false); $this->shouldThrow(new \InvalidArgumentException('Unique code violation message should appear on page, but it does not.'))->during('iShouldBeNotifiedThatTaxCategoryWithThisCodeAlreadyExists', []); }