當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Service\SharedStorageInterface類代碼示例

本文整理匯總了PHP中Sylius\Behat\Service\SharedStorageInterface的典型用法代碼示例。如果您正苦於以下問題:PHP SharedStorageInterface類的具體用法?PHP SharedStorageInterface怎麽用?PHP SharedStorageInterface使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了SharedStorageInterface類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: anEmailWithShipmentDetailsOfOrderShouldBeSentTo

 /**
  * @Then /^an email with shipment's details of (this order) should be sent to "([^"]+)"$/
  */
 public function anEmailWithShipmentDetailsOfOrderShouldBeSentTo(OrderInterface $order, $recipient)
 {
     $this->assertEmailContainsMessageTo($order->getNumber(), $recipient);
     $this->assertEmailContainsMessageTo($order->getLastShipment()->getMethod()->getName(), $recipient);
     $tracking = $this->sharedStorage->get('tracking_code');
     $this->assertEmailContainsMessageTo($tracking, $recipient);
 }
開發者ID:ReissClothing,項目名稱:Sylius,代碼行數:10,代碼來源:EmailContext.php

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

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

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

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

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

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

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

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

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

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

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

示例13: 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);
 }
開發者ID:ReissClothing,項目名稱:Sylius,代碼行數:16,代碼來源:ProductAttributeContext.php

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

示例15: createShippingCategory

 /**
  * @param string $shippingCategoryName
  * @param string $shippingCategoryCode
  */
 private function createShippingCategory($shippingCategoryName, $shippingCategoryCode = null)
 {
     /** @var ShippingCategoryInterface $shippingCategory */
     $shippingCategory = $this->shippingCategoryFactory->createNew();
     $shippingCategory->setName($shippingCategoryName);
     $shippingCategory->setCode($shippingCategoryCode);
     if (null === $shippingCategoryCode) {
         $shippingCategory->setCode(StringInflector::nameToCode($shippingCategoryName));
     }
     $this->shippingCategoryRepository->add($shippingCategory);
     $this->sharedStorage->set('shipping_category', $shippingCategory);
 }
開發者ID:Niiko,項目名稱:Sylius,代碼行數:16,代碼來源:ShippingCategoryContext.php


注:本文中的Sylius\Behat\Service\SharedStorageInterface類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。