當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SharedStorageInterface::get方法代碼示例

本文整理匯總了PHP中Sylius\Component\Core\Test\Services\SharedStorageInterface::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP SharedStorageInterface::get方法的具體用法?PHP SharedStorageInterface::get怎麽用?PHP SharedStorageInterface::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sylius\Component\Core\Test\Services\SharedStorageInterface的用法示例。


在下文中一共展示了SharedStorageInterface::get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: defaultCurrencyIs

 /**
  * @Given default currency is :currencyCode
  */
 public function defaultCurrencyIs($currencyCode)
 {
     $currency = $this->createCurrency($currencyCode);
     $currency->setEnabled(true);
     $channel = $this->sharedStorage->get('channel');
     $channel->setDefaultCurrency($currency);
     $this->saveCurrency($currency);
 }
開發者ID:okwinza,項目名稱:Sylius,代碼行數:11,代碼來源:CurrencyContext.php

示例2: defaultCurrencyIs

 /**
  * @Given default currency is :currencyCode
  */
 public function defaultCurrencyIs($currencyCode)
 {
     $currency = $this->currencyFactory->createNew();
     $currency->setCode($currencyCode);
     $currency->setExchangeRate(1.0);
     $channel = $this->sharedStorage->get('channel');
     $channel->setDefaultCurrency($currency);
     $this->currencyRepository->add($currency);
 }
開發者ID:ahmadrabie,項目名稱:Sylius,代碼行數:12,代碼來源:CurrencyContext.php

示例3: storeHasAProductPricedAt

 /**
  * @Given /^the store has a product "([^"]+)"$/
  * @Given /^the store has a product "([^"]+)" priced at ("[^"]+")$/
  */
 public function storeHasAProductPricedAt($productName, $price = 0)
 {
     $product = $this->productFactory->createNew();
     $product->setName($productName);
     $product->setPrice($price);
     $product->setDescription('Awesome ' . $productName);
     $channel = $this->sharedStorage->get('channel');
     $product->addChannel($channel);
     $this->productRepository->add($product);
     $this->sharedStorage->set('product', $product);
 }
開發者ID:starspire,項目名稱:eventmanager,代碼行數:15,代碼來源:ProductContext.php

示例4: storeAllowsPaying

 /**
  * @Given the store allows paying :paymentMethodName
  * @Given the store allows paying with :paymentMethodName
  */
 public function storeAllowsPaying($paymentMethodName)
 {
     $paymentMethod = $this->paymentMethodFactory->createNew();
     $paymentMethod->setCode('PM_' . $paymentMethodName);
     $paymentMethod->setName(ucfirst($paymentMethodName));
     $paymentMethod->setGateway($this->paymentMethodNameToGatewayConverter->convert($paymentMethodName));
     $paymentMethod->setDescription('Payment method');
     $channel = $this->sharedStorage->get('channel');
     $channel->addPaymentMethod($paymentMethod);
     $this->paymentMethodRepository->add($paymentMethod);
 }
開發者ID:polisys,項目名稱:Sylius,代碼行數:15,代碼來源:PaymentContext.php

示例5:

 function it_throws_runtime_exception_if_cannot_find_last_order_for_given_customer(SharedStorageInterface $sharedStorage, OrderRepositoryInterface $orderRepository, UserInterface $user, CustomerInterface $customer)
 {
     $sharedStorage->get('user')->willReturn($user);
     $user->getCustomer()->willReturn($customer);
     $orderRepository->findByCustomer($customer)->willReturn([]);
     $this->shouldThrow(\RuntimeException::class)->during('iTryToPayAgain');
 }
開發者ID:ahmadrabie,項目名稱:Sylius,代碼行數:7,代碼來源:PaypalContextSpec.php

示例6:

 function it_throws_exception_when_a_coupon_is_found_but_it_should_not_exist(SharedStorageInterface $sharedStorage, RepositoryInterface $couponRepository, CouponInterface $coupon)
 {
     $coupon->getId()->willReturn(5);
     $sharedStorage->get('coupon_id')->willReturn(5);
     $couponRepository->find(5)->willReturn($coupon);
     $this->shouldThrow(NotEqualException::class)->during('couponShouldNotExistInTheRegistry', [5]);
 }
開發者ID:Mozan,項目名稱:Sylius,代碼行數:7,代碼來源:PromotionContextSpec.php

示例7: myDefaultShippingAddressIs

 /**
  * @Given my default shipping address is :country
  */
 public function myDefaultShippingAddressIs($country)
 {
     $user = $this->sharedStorage->get('user');
     $customer = $user->getCustomer();
     $customer->setShippingAddress($this->createAddress($customer->getFirstName(), $customer->getLastName(), $country));
     $this->userManager->flush();
 }
開發者ID:starspire,項目名稱:eventmanager,代碼行數:10,代碼來源:UserContext.php

示例8:

 function it_throws_an_exception_if_a_product_exists_when_it_should_not(SharedStorageInterface $sharedStorage, IndexPageInterface $adminProductIndexPage, ProductInterface $product)
 {
     $sharedStorage->get('product')->willReturn($product);
     $adminProductIndexPage->open()->shouldBeCalled();
     $adminProductIndexPage->isThereProduct($product)->willReturn(true);
     $this->shouldThrow(NotEqualException::class)->during('productShouldNotExist', [$product]);
 }
開發者ID:ahmadrabie,項目名稱:Sylius,代碼行數:7,代碼來源:ProductContextSpec.php

示例9: iShouldSeeTheThankYouPage

 /**
  * @Then I should see the thank you page
  */
 public function iShouldSeeTheThankYouPage()
 {
     /** @var UserInterface $user */
     $user = $this->sharedStorage->get('user');
     $customer = $user->getCustomer();
     expect($this->checkoutThankYouPage->hasThankYouMessageFor($customer->getFullName()))->toBe(true);
 }
開發者ID:vikey89,項目名稱:Sylius,代碼行數:10,代碼來源:CheckoutContext.php

示例10: createOrder

 /**
  * @param CustomerInterface $customer
  * @param string $number
  * @param ChannelInterface|null $channel
  * @param CurrencyInterface|null $currency
  *
  * @return OrderInterface
  */
 private function createOrder(CustomerInterface $customer, $number, ChannelInterface $channel = null, CurrencyInterface $currency = null)
 {
     $order = $this->orderFactory->createNew();
     $order->setCustomer($customer);
     $order->setNumber($number);
     $order->setChannel(null !== $channel ? $channel : $this->sharedStorage->get('channel'));
     $order->setCurrency(null !== $currency ? $currency : $this->sharedStorage->get('currency'));
     return $order;
 }
開發者ID:rpg600,項目名稱:Sylius,代碼行數:17,代碼來源:OrderContext.php

示例11:

 function it_checks_if_account_was_deleted(SharedStorageInterface $sharedStorage, UserInterface $user, CustomerInterface $customer, CustomerShowPage $customerShowPage)
 {
     $sharedStorage->get('deleted_user')->willReturn($user);
     $user->getCustomer()->willReturn($customer);
     $customer->getId()->willReturn(1);
     $customerShowPage->open(['id' => 1])->shouldBeCalled();
     $customerShowPage->isRegistered()->willReturn(false);
     $this->accountShouldBeDeleted();
 }
開發者ID:vikey89,項目名稱:Sylius,代碼行數:9,代碼來源:UserContextSpec.php

示例12:

 function it_checks_if_customer_still_exists(ShowPageInterface $customerShowPage, SharedStorageInterface $sharedStorage, CustomerInterface $customer, UserInterface $user)
 {
     $sharedStorage->get('deleted_user')->shouldBeCalled()->willReturn($user);
     $user->getCustomer()->willReturn($customer);
     $customer->getId()->willReturn(1);
     $customerShowPage->open(['id' => 1])->shouldBeCalled();
     $customerShowPage->isRegistered()->willReturn(false);
     $this->customerShouldStillExist();
 }
開發者ID:ahmadrabie,項目名稱:Sylius,代碼行數:9,代碼來源:CustomerContextSpec.php

示例13: getLastOrder

 /**
  * @return OrderInterface
  *
  * @throws \RuntimeException
  */
 private function getLastOrder()
 {
     $customer = $this->sharedStorage->get('user')->getCustomer();
     $orders = $this->orderRepository->findByCustomer($customer);
     $lastOrder = end($orders);
     if (false === $lastOrder) {
         throw new \RuntimeException(sprintf('There is no last order for %s', $customer->getFullName()));
     }
     return $lastOrder;
 }
開發者ID:ahmadrabie,項目名稱:Sylius,代碼行數:15,代碼來源:PaypalContext.php

示例14: thisProductIsAvailableInSize

 /**
  * @Given /^(this product) is available in "([^"]+)" size priced at ("[^"]+")$/
  */
 public function thisProductIsAvailableInSize(ProductInterface $product, $optionValueName, $price)
 {
     /** @var ProductVariantInterface $variant */
     $variant = $this->productVariantFactory->createNew();
     $optionValue = $this->sharedStorage->get(sprintf('%s_option_value', $optionValueName));
     $variant->addOption($optionValue);
     $variant->setPrice($price);
     $variant->setCode(sprintf("%s_%s", $product->getCode(), $optionValueName));
     $product->addVariant($variant);
     $this->objectManager->flush();
 }
開發者ID:okwinza,項目名稱:Sylius,代碼行數:14,代碼來源:ProductContext.php

示例15:

 function it_creates_a_review_for_a_given_product(SharedStorageInterface $sharedStorage, FactoryInterface $reviewFactory, RepositoryInterface $productReviewRepository, ProductInterface $product, ReviewInterface $review)
 {
     $sharedStorage->get('product')->willReturn($product);
     $reviewFactory->createNew()->willReturn($review);
     $review->setTitle('title')->shouldBeCalled();
     $review->setRating(5)->shouldBeCalled();
     $review->setReviewSubject($product)->shouldBeCalled();
     $product->addReview($review)->shouldBeCalled();
     $productReviewRepository->add($review);
     $this->productHasAReview($product);
 }
開發者ID:ahmadrabie,項目名稱:Sylius,代碼行數:11,代碼來源:ProductReviewContextSpec.php


注:本文中的Sylius\Component\Core\Test\Services\SharedStorageInterface::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。