コード例 #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
 /**
  * @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));
 }
コード例 #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
 /**
  * @Then :it should be successfully removed
  */
 public function shippingMethodShouldBeRemoved(ShippingMethodInterface $shippingMethod)
 {
     expect($this->shippingMethodIndexPage->isOpen())->toBe(true);
     expect($this->shippingMethodIndexPage->isThereShippingMethodNamed($shippingMethod->getName()))->toBe(false);
 }