/** * {@inheritdoc} */ public function hasShippingMethod(ShippingMethodInterface $shippingMethod) { if (!$this->hasElement('shipping_method')) { return false; } return false !== strpos($this->getElement('shipping_method')->getText(), $shippingMethod->getName()); }
/** * @Given the shipping method :shippingMethod is disabled */ public function theShippingMethodIsDisabled(ShippingMethodInterface $shippingMethod) { $shippingMethod->disable(); $this->shippingMethodManager->flush(); }
function it_checks_if_there_was_no_redirect_to_index_after_unsuccessful_deletion_of_a_shipping_method(ShowPageInterface $shippingMethodShowPage, IndexPageInterface $shippingMethodIndexPage, ShippingMethodInterface $shippingMethod) { $shippingMethod->getName()->willReturn('UPS Express'); $shippingMethod->getId()->willReturn(5); $shippingMethodShowPage->isOpen(['id' => 5])->willReturn(false); $shippingMethodIndexPage->isThereShippingMethodNamed('UPS Express')->willReturn(true); $this->shouldThrow(NotEqualException::class)->during('shippingMethodShouldNotBeRemoved', [$shippingMethod]); }
function it_assigns_product_for_given_tax_category($shippingMethodManager, ShippingMethodInterface $shippingMethod, TaxCategoryInterface $taxCategory) { $shippingMethod->setTaxCategory($taxCategory)->shouldBeCalled(); $shippingMethodManager->flush()->shouldBeCalled(); $this->shippingMethodBelongsToTaxCategory($shippingMethod, $taxCategory); }
/** * @param ShippingMethodInterface $shippingMethod * @param bool $state */ private function assertShippingMethodState(ShippingMethodInterface $shippingMethod, $state) { $this->iWantToBrowseShippingMethods(); Assert::true($this->indexPage->isSingleResourceOnPage(['name' => $shippingMethod->getName(), 'enabled' => $state]), sprintf('Shipping method with name %s and state %s has not been found.', $shippingMethod->getName(), $state)); }
/** * @Given /^(shipping method "[^"]+") belongs to ("[^"]+" tax category)$/ */ public function shippingMethodBelongsToTaxCategory(ShippingMethodInterface $shippingMethod, TaxCategoryInterface $taxCategory) { $shippingMethod->setTaxCategory($taxCategory); $this->shippingMethodManager->flush(); }
/** * @Given /^(this shipping method) requires that no units match to ("([^"]+)" shipping category)$/ */ public function thisShippingMethodRequiresThatNoUnitsMatchToShippingCategory(ShippingMethodInterface $shippingMethod, ShippingCategoryInterface $shippingCategory) { $shippingMethod->setCategory($shippingCategory); $shippingMethod->setCategoryRequirement(ShippingMethodInterface::CATEGORY_REQUIREMENT_MATCH_NONE); $this->shippingMethodManager->flush(); }
/** * @Then :it should not be removed */ public function shippingMethodShouldNotBeRemoved(ShippingMethodInterface $shippingMethod) { expect($this->shippingMethodShowPage->isOpen(['id' => $shippingMethod->getId()]))->toBe(true); expect($this->shippingMethodShowPage->verify(['id' => $shippingMethod->getId()]))->toNotThrow(UnexpectedPageException::class); }