本文整理汇总了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()));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例9: getLatestChannel
/**
* @Transform /(?:this|that|the) channel/
*/
public function getLatestChannel()
{
return $this->sharedStorage->getCurrentResource('channel');
}