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


PHP Services\SharedStorageInterface类代码示例

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


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

示例1:

 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

示例2:

 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

示例3:

 function it_sets_default_channel_in_the_shared_storage(SharedStorageInterface $sharedStorage, DefaultStoreDataInterface $defaultFranceChannelFactory, ChannelInterface $channel, ZoneInterface $zone)
 {
     $defaultData = ['channel' => $channel, 'zone' => $zone];
     $defaultFranceChannelFactory->create()->willReturn($defaultData);
     $sharedStorage->setClipboard($defaultData)->shouldBeCalled();
     $this->thatStoreIsOperatingOnASingleChannel();
 }
开发者ID:stevedien,项目名称:Sylius,代码行数:7,代码来源:ChannelContextSpec.php

示例4:

 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

示例5:

 function it_creates_a_tax_category_with_name_and_code(SharedStorageInterface $sharedStorage, TaxCategoryInterface $taxCategory, TaxCategoryRepositoryInterface $taxCategoryRepository, FactoryInterface $taxCategoryFactory)
 {
     $taxCategoryFactory->createNew()->willReturn($taxCategory);
     $taxCategory->setName('Alcohol')->shouldBeCalled();
     $taxCategory->setCode('alcohol')->shouldBeCalled();
     $taxCategoryRepository->add($taxCategory)->shouldBeCalled();
     $sharedStorage->set('tax_category', $taxCategory)->shouldBeCalled();
     $this->theStoreHasTaxCategoryWithCode('Alcohol', 'alcohol');
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:9,代码来源:TaxationContextSpec.php

示例6:

 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

示例7:

 function it_throws_invalid_argument_exception_if_cannot_convert_locale_name_to_code(FactoryInterface $localeFactory, LocaleInterface $locale, LocaleNameConverterInterface $localeNameConverter, RepositoryInterface $localeRepository, SharedStorageInterface $sharedStorage)
 {
     $localeFactory->createNew()->willReturn($locale);
     $localeNameConverter->convertToCode('xyz')->willThrow(\InvalidArgumentException::class);
     $locale->setCode('no')->shouldNotBeCalled();
     $sharedStorage->set('locale', $locale)->shouldNotBeCalled();
     $localeRepository->add($locale)->shouldNotBeCalled();
     $this->shouldThrow(\InvalidArgumentException::class)->during('theStoreHasLocale', ['xyz']);
     $this->shouldThrow(\InvalidArgumentException::class)->during('theStoreHasDisabledLocale', ['xyz']);
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:10,代码来源:LocaleContextSpec.php

示例8:

 function it_configures_that_store_operates_in_given_country_disabled_by_default(CountryInterface $country, CountryNameConverterInterface $nameToCodeConverter, FactoryInterface $countryFactory, RepositoryInterface $countryRepository, SharedStorageInterface $sharedStorage)
 {
     $countryFactory->createNew()->willReturn($country);
     $nameToCodeConverter->convertToCode('France')->willReturn('FR');
     $country->setCode('FR')->shouldBeCalled();
     $country->disable()->shouldBeCalled();
     $sharedStorage->set('country', $country)->shouldBeCalled();
     $countryRepository->add($country)->shouldBeCalled();
     $this->theStoreHasDisabledCountry('France');
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:10,代码来源:GeographicalContextSpec.php

示例9:

 function it_creates_fixed_discount_promotion_for_cart_with_specified_quantity(ActionFactoryInterface $actionFactory, ActionInterface $action, ObjectManager $objectManager, PromotionInterface $promotion, RuleFactoryInterface $ruleFactory, RuleInterface $rule, SharedStorageInterface $sharedStorage)
 {
     $sharedStorage->get('promotion')->willReturn($promotion);
     $actionFactory->createFixedDiscount(1000)->willReturn($action);
     $promotion->addAction($action)->shouldBeCalled();
     $ruleFactory->createCartQuantity(5)->willReturn($rule);
     $promotion->addRule($rule)->shouldBeCalled();
     $objectManager->flush()->shouldBeCalled();
     $this->itGivesFixedDiscountToEveryOrderWithQuantityAtLeast($promotion, 1000, '5');
 }
开发者ID:Mozan,项目名称:Sylius,代码行数:10,代码来源:PromotionContextSpec.php

示例10: 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);
 }
开发者ID:okwinza,项目名称:Sylius,代码行数:10,代码来源:SecurityContext.php

示例11: 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);
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:10,代码来源:GeographicalContext.php

示例12: 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);
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:10,代码来源:ChannelContext.php

示例13: 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

示例14: 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);
 }
开发者ID:okwinza,项目名称:Sylius,代码行数:11,代码来源:ProductOptionContext.php

示例15: 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);
 }
开发者ID:okwinza,项目名称:Sylius,代码行数:11,代码来源:ThemeContext.php


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