当前位置: 首页>>代码示例>>PHP>>正文


PHP SharedStorageInterface::getCurrentResource方法代码示例

本文整理汇总了PHP中Sylius\Component\Core\Test\Services\SharedStorageInterface::getCurrentResource方法的典型用法代码示例。如果您正苦于以下问题:PHP SharedStorageInterface::getCurrentResource方法的具体用法?PHP SharedStorageInterface::getCurrentResource怎么用?PHP SharedStorageInterface::getCurrentResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sylius\Component\Core\Test\Services\SharedStorageInterface的用法示例。


在下文中一共展示了SharedStorageInterface::getCurrentResource方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: iShouldSeeTheThankYouPage

 /**
  * @Then I should see the thank you page
  */
 public function iShouldSeeTheThankYouPage()
 {
     $user = $this->sharedStorage->getCurrentResource('user');
     $customer = $user->getCustomer();
     $thankYouPage = $this->getPage('Checkout\\CheckoutThankYouPage');
     $thankYouPage->assertRoute();
     $this->assertSession()->elementTextContains('css', '#thanks', sprintf('Thank you %s', $customer->getFullName()));
 }
开发者ID:Spomky,项目名称:Sylius,代码行数:11,代码来源:CheckoutContext.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->getCurrentResource('channel');
     $channel->setDefaultCurrency($currency);
     $this->currencyRepository->add($currency);
 }
开发者ID:Spomky,项目名称:Sylius,代码行数:12,代码来源:CurrencyContext.php

示例3: catalogHasAProductPricedAt

 /**
  * @Given catalog has a product :productName priced at $:price
  */
 public function catalogHasAProductPricedAt($productName, $price)
 {
     $product = $this->productFactory->createNew();
     $product->setName($productName);
     $product->setPrice((int) $price);
     $product->setDescription('Awesome star wars mug');
     $channel = $this->sharedStorage->getCurrentResource('channel');
     $product->addChannel($channel);
     $this->productRepository->add($product);
 }
开发者ID:Spomky,项目名称:Sylius,代码行数:13,代码来源:ProductContext.php

示例4: storeAllowsPayingOffline

 /**
  * @Given store allows paying offline
  */
 public function storeAllowsPayingOffline()
 {
     $paymentMethod = $this->paymentMethodFactory->createNew();
     $paymentMethod->setCode('PM1');
     $paymentMethod->setGateway('dummy');
     $paymentMethod->setName('Offline');
     $paymentMethod->setDescription('Offline payment method');
     $channel = $this->sharedStorage->getCurrentResource('channel');
     $channel->addPaymentMethod($paymentMethod);
     $this->paymentMethodRepository->add($paymentMethod);
 }
开发者ID:Spomky,项目名称:Sylius,代码行数:14,代码来源:PaymentContext.php

示例5: storeHasFreeShippingMethod

 /**
  * @Given store has free shipping method
  */
 public function storeHasFreeShippingMethod()
 {
     $zone = $this->sharedStorage->getCurrentResource('zone');
     $shippingMethod = $this->shippingMethodFactory->createNew();
     $shippingMethod->setCode('SM1');
     $shippingMethod->setName('Free');
     $shippingMethod->setCurrentLocale('FR');
     $shippingMethod->setConfiguration(array('amount' => 0));
     $shippingMethod->setCalculator(DefaultCalculators::PER_ITEM_RATE);
     $shippingMethod->setZone($zone);
     $this->shippingMethodRepository->add($shippingMethod);
 }
开发者ID:Spomky,项目名称:Sylius,代码行数:15,代码来源:ShippingContext.php

示例6: createShippingMethod

 /**
  * @param string $name
  * @param string $locale
  * @param array $configuration
  * @param string $calculator
  * @param ZoneInterface|null $zone
  */
 private function createShippingMethod($name, $locale = 'en', $configuration = ['amount' => 0], $calculator = DefaultCalculators::FLAT_RATE, $zone = null)
 {
     if (null === $zone) {
         $zone = $this->sharedStorage->getCurrentResource('zone');
     }
     $shippingMethod = $this->shippingMethodFactory->createNew();
     $shippingMethod->setCode($this->getCodeFromName($name));
     $shippingMethod->setName($name);
     $shippingMethod->setCurrentLocale($locale);
     $shippingMethod->setConfiguration($configuration);
     $shippingMethod->setCalculator($calculator);
     $shippingMethod->setZone($zone);
     $this->shippingMethodRepository->add($shippingMethod);
 }
开发者ID:dszwcz,项目名称:Sylius,代码行数:21,代码来源:ShippingContext.php

示例7: iShouldSeeTheThankYouPage

 /**
  * @Then I should see the thank you page
  */
 public function iShouldSeeTheThankYouPage()
 {
     /** @var UserInterface $user */
     $user = $this->sharedStorage->getCurrentResource('user');
     $customer = $user->getCustomer();
     expect($this->checkoutThankYouPage->hasThankYouMessageFor($customer->getFullName()))->toBe(true);
 }
开发者ID:Andretti23,项目名称:Sylius,代码行数:10,代码来源:CheckoutContext.php

示例8: itComesInTheFollowingVariations

 /**
  * @Given /^it comes in the following variations:$/
  */
 public function itComesInTheFollowingVariations(TableNode $table)
 {
     $currentProduct = $this->sharedStorage->getCurrentResource('product');
     foreach ($table->getHash() as $variantHash) {
         $variant = $this->productVariantFactory->createNew();
         $variant->setPresentation($variantHash['name']);
         $variant->setPrice($this->getPriceFromString(str_replace(['$', '€', '£'], '', $variantHash['price'])));
         $variant->setProduct($currentProduct);
         $this->productRepository->add($variant);
     }
     $this->objectManager->flush();
 }
开发者ID:stevedien,项目名称:Sylius,代码行数:15,代码来源:ProductContext.php

示例9: getLatestChannel

 /**
  * @Transform /(?:this|that|the) channel/
  */
 public function getLatestChannel()
 {
     return $this->sharedStorage->getCurrentResource('channel');
 }
开发者ID:Andretti23,项目名称:Sylius,代码行数:7,代码来源:ChannelContext.php


注:本文中的Sylius\Component\Core\Test\Services\SharedStorageInterface::getCurrentResource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。