/** * @Then tax category with :element :name should not be added */ public function taxCategoryWithElementValueShouldNotBeAdded($element, $name) { $this->indexPage->open(); Assert::false($this->indexPage->isResourceOnPage([$element => $name]), sprintf('Tax category with %s %s was created, but it should not.', $element, $name)); }
/** * @param TaxRateInterface $taxRate * @param string $element * @param string $taxRateElement */ private function assertFieldValue(TaxRateInterface $taxRate, $element, $taxRateElement) { $this->indexPage->open(); Assert::true($this->indexPage->isResourceOnPage(['code' => $taxRate->getCode(), $element => $taxRateElement]), sprintf('Tax rate %s %s has not been assigned properly.', $element, $taxRateElement)); }
function it_throws_not_equal_exception_if_country_does_not_appear_in_the_store(IndexPageInterface $countryIndexPage, CountryInterface $country) { $country->getCode()->willReturn('FR'); $countryIndexPage->isResourceOnPage(['code' => 'FR'])->willReturn(false); $this->shouldThrow(NotEqualException::class)->during('countryWithNameShouldAppearInTheStore', [$country]); }
/** * @Given /^(country "([^"]*)") should appear in the store$/ */ public function countryWithNameShouldAppearInTheStore(CountryInterface $country) { expect($this->countryIndexPage->isResourceOnPage(['code' => $country->getCode()]))->toBe(true); }
function it_throws_an_exception_if_resource_can_not_be_founded_on_page(IndexPageInterface $indexPage) { $indexPage->isResourceOnPage(['name' => 'Norwegian'])->willReturn(false); $this->shouldThrow(NotEqualException::class)->during('storeShouldBeAvailableInLanguage', ['Norwegian']); }
function it_throws_an_exception_if_resource_with_given_name_exist_but_it_should_not(IndexPageInterface $indexPage) { $indexPage->open()->shouldBeCalled(); $indexPage->isResourceOnPage(['name' => 'Food and Beverage'])->willReturn(true); $this->shouldThrow(new \InvalidArgumentException('Tax category with name Food and Beverage was created, but it should not.'))->during('taxCategoryWithElementValueShouldNotBeAdded', ['name', 'Food and Beverage']); }
/** * @Then the store should be available in the :name language */ public function storeShouldBeAvailableInLanguage($name) { expect($this->indexPage->isResourceOnPage(['name' => $name]))->toBe(true); }