本文整理匯總了PHP中Sylius\Component\Core\Test\Services\SharedStorageInterface::set方法的典型用法代碼示例。如果您正苦於以下問題:PHP SharedStorageInterface::set方法的具體用法?PHP SharedStorageInterface::set怎麽用?PHP SharedStorageInterface::set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sylius\Component\Core\Test\Services\SharedStorageInterface
的用法示例。
在下文中一共展示了SharedStorageInterface::set方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: theStoreHasDisabledCountry
/**
* @Given /^the store has disabled country "([^"]*)"$/
*/
public function theStoreHasDisabledCountry($countryName)
{
$country = $this->createCountryNamed(trim($countryName));
$country->disable();
$this->sharedStorage->set('country', $country);
$this->countryRepository->add($country);
}
示例2: theStoreOperatesOnAChannelNamed
/**
* @Given /^the store operates on (?:a|another) channel named "([^"]+)"$/
*/
public function theStoreOperatesOnAChannelNamed($channelName)
{
$channel = $this->channelFactory->createNamed($channelName);
$channel->setCode($channelName);
$this->channelRepository->add($channel);
$this->sharedStorage->set('channel', $channel);
}
示例3: iAmLoggedInAsAnAdministrator
/**
* @Given I am logged in as an administrator
*/
public function iAmLoggedInAsAnAdministrator()
{
$admin = $this->testUserFactory->createDefaultAdmin();
$this->userRepository->add($admin);
$this->securityService->logIn($admin->getEmail());
$this->sharedStorage->set('admin', $admin);
}
示例4: iDeleteAccount
/**
* @When I delete the account of :email user
*/
public function iDeleteAccount($email)
{
$user = $this->userRepository->findOneByEmail($email);
$this->sharedStorage->set('deleted_user', $user);
$this->customerShowPage->open(['id' => $user->getCustomer()->getId()]);
$this->customerShowPage->deleteAccount();
}
示例5: iSetChannelThemeTo
/**
* @When I set :channel channel theme to :theme
*/
public function iSetChannelThemeTo(ChannelInterface $channel, ThemeInterface $theme)
{
$this->channelUpdatePage->open(['id' => $channel->getId()]);
$this->channelUpdatePage->setTheme($theme);
$this->channelUpdatePage->saveChanges();
$this->sharedStorage->set('channel', $channel);
$this->sharedStorage->set('theme', $theme);
}
示例6: theStoreHasDisabledLocale
/**
* @Given the store has disabled locale :localeName
*/
public function theStoreHasDisabledLocale($localeName)
{
$locale = $this->localeFactory->createNew();
$locale->setCode($this->localeNameConverter->convertToCode($localeName));
$locale->disable();
$this->sharedStorage->set('locale', $locale);
$this->localeRepository->add($locale);
}
示例7: theStoreHasAProductOptionWithACode
/**
* @Given the store has a product option :productOptionName with a code :productOptionCode
*/
public function theStoreHasAProductOptionWithACode($productOptionName, $productOptionCode)
{
$productOption = $this->productOptionFactory->createNew();
$productOption->setCode($productOptionCode);
$productOption->setName($productOptionName);
$this->sharedStorage->set('product_option', $productOption);
$this->productOptionRepository->add($productOption);
}
示例8: iCreateNewChannel
/**
* @When I create a new channel :channelName
*/
public function iCreateNewChannel($channelName)
{
$this->channelCreatePage->open();
$this->channelCreatePage->nameIt($channelName);
$this->channelCreatePage->specifyCode($channelName);
$this->channelCreatePage->create();
$channel = $this->channelRepository->findOneBy(['name' => $channelName]);
$this->sharedStorage->set('channel', $channel);
}
示例9: 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);
}
示例10: createProductAttribute
/**
* @param string $type
* @param string $name
* @param string|null $code
*/
private function createProductAttribute($type, $name, $code = null)
{
$productAttribute = $this->productAttributeFactory->createTyped($type);
if (null === $code) {
$code = str_replace(' ', '_', strtoupper($name));
}
$productAttribute->setCode($code);
$productAttribute->setName($name);
$this->productAttributeRepository->add($productAttribute);
$this->sharedStorage->set('product_attribute', $productAttribute);
}
示例11:
function it_creates_promotion_with_coupon(SharedStorageInterface $sharedStorage, CouponFactoryInterface $couponFactory, TestPromotionFactoryInterface $testPromotionFactory, PromotionRepositoryInterface $promotionRepository, ChannelInterface $channel, CouponInterface $coupon, PromotionInterface $promotion)
{
$couponFactory->createNew()->willReturn($coupon);
$coupon->setCode('Coupon galore')->shouldBeCalled();
$sharedStorage->get('channel')->willReturn($channel);
$testPromotionFactory->createForChannel('Promotion galore', $channel)->willReturn($promotion);
$promotion->addCoupon($coupon)->shouldBeCalled();
$promotion->setCouponBased(true)->shouldBeCalled();
$promotionRepository->add($promotion)->shouldBeCalled();
$sharedStorage->set('promotion', $promotion)->shouldBeCalled();
$sharedStorage->set('coupon', $coupon)->shouldBeCalled();
$this->thereIsPromotionWithCoupon('Promotion galore', 'Coupon galore');
}
示例12:
function it_deletes_an_order(SharedStorageInterface $sharedStorage, AddressInterface $shippingAddress, AddressInterface $billingAddress, AdjustmentInterface $adjustment, OrderRepositoryInterface $orderRepository, OrderInterface $order)
{
$orderRepository->findOneBy(['number' => '#00000000'])->willReturn($order);
$order->getBillingAddress()->willReturn($billingAddress);
$order->getShippingAddress()->willReturn($shippingAddress);
$order->getAdjustments()->willReturn([$adjustment]);
$billingAddress->getId()->willReturn(3);
$shippingAddress->getId()->willReturn(2);
$adjustment->getId()->willReturn(1);
$orderRepository->remove($order)->shouldBeCalled();
$sharedStorage->set('deleted_adjustments', [1])->shouldBeCalled();
$sharedStorage->set('deleted_addresses', [2, 3])->shouldBeCalled();
$this->iDeleteTheOrder('#00000000');
}
示例13: iDeleteTheOrder
/**
* @When I delete the order :orderNumber
*/
public function iDeleteTheOrder($orderNumber)
{
/** @var OrderInterface $order */
$order = $this->orderRepository->findOneBy(['number' => $orderNumber]);
if (null === $order) {
throw new \InvalidArgumentException(sprintf('Order with %s number was not found in an order repository', $orderNumber));
}
$adjustmentsId = [];
foreach ($order->getAdjustments() as $adjustment) {
$adjustmentsId[] = $adjustment->getId();
}
$this->sharedStorage->set('deleted_adjustments', $adjustmentsId);
$this->sharedStorage->set('deleted_addresses', [$order->getShippingAddress()->getId(), $order->getBillingAddress()->getId()]);
$this->orderRepository->remove($order);
}
示例14: thereIsAnAdministratorIdentifiedBy
/**
* @Given there is an administrator identified by :email
*/
public function thereIsAnAdministratorIdentifiedBy($email)
{
$administrator = $this->userFactory->createDefaultAdmin();
$administrator->setEmail($email);
$this->sharedStorage->set('administrator', $administrator);
$this->userRepository->add($administrator);
}
示例15: iPlacedAnOrder
/**
* @Given /^(I) placed (an order "[^"]+")$/
*/
public function iPlacedAnOrder(UserInterface $user, $orderNumber)
{
$customer = $user->getCustomer();
$order = $this->createOrder($customer, $orderNumber);
$this->sharedStorage->set('order', $order);
$this->orderRepository->add($order);
}