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


PHP SharedStorageInterface::set方法代码示例

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


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

示例1: iAmLoggedInAsAdministrator

 /**
  * @Given /^I am logged in as "([^"]+)" administrator$/
  */
 public function iAmLoggedInAsAdministrator($email)
 {
     $user = $this->userRepository->findOneByEmail($email);
     Assert::notNull($user);
     $this->securityService->logIn($user);
     $this->sharedStorage->set('admin', $user);
 }
开发者ID:origammi,项目名称:Sylius,代码行数:10,代码来源:AdminSecurityContext.php

示例2: iAmLoggedInCustomer

 /**
  * @Given I am a logged in customer
  */
 public function iAmLoggedInCustomer()
 {
     $user = $this->userFactory->create();
     $this->userRepository->add($user);
     $this->securityService->logIn($user);
     $this->sharedStorage->set('user', $user);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:10,代码来源:ShopSecurityContext.php

示例3: theStoreHasStaticContentWithName

 /**
  * @Given the store has static content :title with name :name
  */
 public function theStoreHasStaticContentWithName($title, $name)
 {
     $staticContent = $this->staticContentExampleFactory->create(['title' => $title, 'name' => $name]);
     $this->staticContentManager->persist($staticContent);
     $this->staticContentManager->flush();
     $this->sharedStorage->set('static_content', $staticContent);
 }
开发者ID:loic425,项目名称:Sylius,代码行数:10,代码来源:StaticContentContext.php

示例4: thereIsAnAdministratorWithName

 /**
  * @Given there is an administrator with name :username
  */
 public function thereIsAnAdministratorWithName($username)
 {
     $adminUser = $this->userFactory->create(['username' => $username]);
     $adminUser->setUsername($username);
     $this->userRepository->add($adminUser);
     $this->sharedStorage->set('administrator', $adminUser);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:10,代码来源:AdminUserContext.php

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

示例6: 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:TeamNovatek,项目名称:Sylius,代码行数:10,代码来源:SecurityContext.php

示例7: iAmLoggedInCustomer

 /**
  * @Given I am a logged in customer
  */
 public function iAmLoggedInCustomer()
 {
     $user = $this->userFactory->create(['email' => 'sylius@example.com', 'password' => 'sylius', 'enabled' => true]);
     $this->userRepository->add($user);
     $this->securityService->logIn($user);
     $this->sharedStorage->set('user', $user);
 }
开发者ID:sylius,项目名称:sylius,代码行数:10,代码来源:ShopSecurityContext.php

示例8: 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:ReissClothing,项目名称:Sylius,代码行数:11,代码来源:ProductOptionContext.php

示例9: theStoreHasRouteWithAsItsContent

 /**
  * @Given the store has route :name with :contentTitle as its content
  */
 public function theStoreHasRouteWithAsItsContent($name, $contentTitle)
 {
     $content = $this->staticContentRepository->findOneBy(['title' => $contentTitle]);
     $route = $this->routeExampleFactory->create(['name' => $name, 'content' => $content]);
     $this->routeManager->persist($route);
     $this->routeManager->flush();
     $this->sharedStorage->set('route', $route);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:11,代码来源:RouteContext.php

示例10: 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:ReissClothing,项目名称:Sylius,代码行数:11,代码来源:ThemeContext.php

示例11: iTryToDeletePromotion

 /**
  * @When /^I delete a ("([^"]+)" promotion)$/
  * @When /^I try to delete a ("([^"]+)" promotion)$/
  */
 public function iTryToDeletePromotion(PromotionInterface $promotion)
 {
     try {
         $this->promotionRepository->remove($promotion);
     } catch (ForeignKeyConstraintViolationException $exception) {
         $this->sharedStorage->set('last_exception', $exception);
     }
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:12,代码来源:ManagingPromotionsContext.php

示例12: createCustomerGroup

 /**
  * @param string $name
  */
 private function createCustomerGroup($name)
 {
     /** @var CustomerGroupInterface $customerGroup */
     $customerGroup = $this->customerGroupFactory->createNew();
     $customerGroup->setName(ucfirst($name));
     $this->sharedStorage->set('customer_group', $customerGroup);
     $this->customerGroupRepository->add($customerGroup);
 }
开发者ID:TheMadeleine,项目名称:Sylius,代码行数:11,代码来源:CustomerGroupContext.php

示例13: iDeleteTheProduct

 /**
  * @When /^I delete the ("[^"]+" product)$/
  * @When /^I try to delete the ("([^"]+)" product)$/
  */
 public function iDeleteTheProduct(ProductInterface $product)
 {
     try {
         $this->sharedStorage->set('product_id', $product->getId());
         $this->productRepository->remove($product);
     } catch (DBALException $exception) {
         $this->sharedStorage->set('last_exception', $exception);
     }
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:13,代码来源:ManagingProductsContext.php

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

示例15: 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 = StringInflector::nameToUppercaseCode($name);
     }
     $productAttribute->setCode($code);
     $productAttribute->setName($name);
     $this->productAttributeRepository->add($productAttribute);
     $this->sharedStorage->set('product_attribute', $productAttribute);
 }
开发者ID:loic425,项目名称:Sylius,代码行数:16,代码来源:ProductAttributeContext.php


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