コード例 #1
0
ファイル: CompletePage.php プロジェクト: ReissClothing/Sylius
 /**
  * {@inheritdoc}
  */
 public function hasShippingMethod(ShippingMethodInterface $shippingMethod)
 {
     if (!$this->hasElement('shipping_method')) {
         return false;
     }
     return false !== strpos($this->getElement('shipping_method')->getText(), $shippingMethod->getName());
 }
コード例 #2
0
 /**
  * @Given the shipping method :shippingMethod is disabled
  */
 public function theShippingMethodIsDisabled(ShippingMethodInterface $shippingMethod)
 {
     $shippingMethod->disable();
     $this->shippingMethodManager->flush();
 }
コード例 #3
0
 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]);
 }
コード例 #4
0
 function it_assigns_product_for_given_tax_category($shippingMethodManager, ShippingMethodInterface $shippingMethod, TaxCategoryInterface $taxCategory)
 {
     $shippingMethod->setTaxCategory($taxCategory)->shouldBeCalled();
     $shippingMethodManager->flush()->shouldBeCalled();
     $this->shippingMethodBelongsToTaxCategory($shippingMethod, $taxCategory);
 }
コード例 #5
0
 /**
  * @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));
 }
コード例 #6
0
ファイル: ShippingContext.php プロジェクト: Andretti23/Sylius
 /**
  * @Given /^(shipping method "[^"]+") belongs to ("[^"]+" tax category)$/
  */
 public function shippingMethodBelongsToTaxCategory(ShippingMethodInterface $shippingMethod, TaxCategoryInterface $taxCategory)
 {
     $shippingMethod->setTaxCategory($taxCategory);
     $this->shippingMethodManager->flush();
 }
コード例 #7
0
ファイル: ShippingContext.php プロジェクト: Niiko/Sylius
 /**
  * @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();
 }
コード例 #8
0
 /**
  * @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);
 }