当前位置: 首页>>代码示例>>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;未经允许,请勿转载。