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


PHP CmsIndex::getStoreSwitcherBlock方法代码示例

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


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

示例1: processAssert

 /**
  * Assert that created store view available on frontend (store view selector on page top)
  *
  * @param Store $store
  * @param CmsIndex $cmsIndex
  * @return void
  */
 public function processAssert(Store $store, CmsIndex $cmsIndex)
 {
     $cmsIndex->open();
     if ($cmsIndex->getFooterBlock()->isStoreGroupSwitcherVisible() && $cmsIndex->getFooterBlock()->isStoreGroupVisible($store)) {
         $cmsIndex->getFooterBlock()->selectStoreGroup($store);
     }
     $isStoreViewVisible = !$cmsIndex->getStoreSwitcherBlock()->isStoreViewDropdownVisible() ? true : $cmsIndex->getStoreSwitcherBlock()->isStoreViewVisible($store);
     \PHPUnit_Framework_Assert::assertTrue($isStoreViewVisible, "Store view is not visible in dropdown on CmsIndex page");
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:AssertStoreFrontend.php

示例2: processAssert

 /**
  * Add created variable to page and assert that Custom Variable is displayed on frontend page and has
  * correct data according to dataset.
  *
  * @param SystemVariable $customVariable
  * @param CmsIndex $cmsIndex
  * @param SystemVariable $variable
  * @param FixtureFactory $fixtureFactory
  * @param BrowserInterface $browser
  * @param Store $storeOrigin
  * @param SystemVariable $customVariableOrigin
  * @return void
  */
 public function processAssert(SystemVariable $customVariable, CmsIndex $cmsIndex, SystemVariable $variable, FixtureFactory $fixtureFactory, BrowserInterface $browser, Store $storeOrigin = null, SystemVariable $customVariableOrigin = null)
 {
     $cmsPage = $fixtureFactory->createByCode('cmsPage', ['dataset' => 'default', 'data' => ['content' => ['content' => '{{customVar code=' . $customVariable->getCode() . '}}']]]);
     $cmsPage->persist();
     $browser->open($_ENV['app_frontend_url'] . $cmsPage->getIdentifier());
     $cmsIndex->getStoreSwitcherBlock()->selectStoreView('Default Store View');
     $htmlValue = $customVariableOrigin ? $this->getHtmlValue($customVariable, $customVariableOrigin) : strip_tags($customVariable->getHtmlValue());
     $pageContent = $cmsIndex->getCmsPageBlock()->getPageContent();
     $this->checkVariable($htmlValue, $pageContent);
     if ($storeOrigin !== null) {
         $cmsIndex->getStoreSwitcherBlock()->selectStoreView($storeOrigin->getName());
         $htmlValue = strip_tags($customVariable->getHtmlValue());
         if ($htmlValue === '') {
             $htmlValue = strip_tags($variable->getHtmlValue());
         }
         $pageContent = $cmsIndex->getCmsPageBlock()->getPageContent();
         $this->checkVariable($htmlValue, $pageContent);
     }
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:32,代码来源:AssertCustomVariableInPage.php

示例3: processAssert

 /**
  * Assert that category name is different on different store view.
  *
  * @param BrowserInterface $browser
  * @param CatalogCategoryView $categoryView
  * @param Category $category
  * @param Category $initialCategory
  * @param CmsIndex $cmsIndex
  * @return void
  */
 public function processAssert(BrowserInterface $browser, CatalogCategoryView $categoryView, Category $category, Category $initialCategory, CmsIndex $cmsIndex)
 {
     $cmsIndex->open();
     $cmsIndex->getLinksBlock()->waitWelcomeMessage();
     $browser->open($_ENV['app_frontend_url'] . $initialCategory->getUrlKey() . '.html');
     \PHPUnit_Framework_Assert::assertEquals($initialCategory->getName(), $categoryView->getTitleBlock()->getTitle(), 'Wrong category name is displayed for default store.');
     $store = $category->getDataFieldConfig('store_id')['source']->store->getName();
     $cmsIndex->getStoreSwitcherBlock()->selectStoreView($store);
     $cmsIndex->getLinksBlock()->waitWelcomeMessage();
     $browser->open($_ENV['app_frontend_url'] . $initialCategory->getUrlKey() . '.html');
     \PHPUnit_Framework_Assert::assertEquals($category->getName(), $categoryView->getTitleBlock()->getTitle(), 'Wrong category name is displayed for ' . $store);
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:22,代码来源:AssertCategoryWithCustomStoreOnFrontend.php

示例4: processAssert

 /**
  * Assert that locale options can be changed and checks new text on index page.
  *
  * @param SystemConfig $systemConfig
  * @param Store $store
  * @param CmsIndex $cmsIndex
  * @param string $locale
  * @param string $welcomeText
  * @return void
  */
 public function processAssert(SystemConfig $systemConfig, Store $store, CmsIndex $cmsIndex, $locale, $welcomeText)
 {
     // Set locale options
     $systemConfig->open();
     $systemConfig->getPageActions()->selectStore($store->getGroupId() . "/" . $store->getName());
     $configGroup = $systemConfig->getForm()->getGroup('Locale Options');
     $configGroup->open();
     $configGroup->setValue('select-groups-locale-fields-code-value', $locale);
     $systemConfig->getPageActions()->save();
     $systemConfig->getMessagesBlock()->waitSuccessMessage();
     // Check presents income text on index page
     $cmsIndex->open();
     $cmsIndex->getStoreSwitcherBlock()->selectStoreView($store->getName());
     \PHPUnit_Framework_Assert::assertTrue($cmsIndex->getSearchBlock()->isPlaceholderContains($welcomeText), "Locale not applied.");
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:25,代码来源:AssertStoreCanBeLocalized.php

示例5: processAssert

 /**
  * Assert that locale options can be changed and checks new text on index page.
  *
  * @param SystemConfig $systemConfig
  * @param Store $store
  * @param CmsIndex $cmsIndex
  * @param AdminCache $adminCache
  * @param string $locale
  * @param string $welcomeText
  */
 public function processAssert(SystemConfig $systemConfig, Store $store, CmsIndex $cmsIndex, AdminCache $adminCache, $locale, $welcomeText)
 {
     // Set locale options
     $systemConfig->open();
     $systemConfig->getPageActions()->selectStore($store->getGroupId() . "/" . $store->getName());
     $systemConfig->getModalBlock()->acceptAlert();
     $configGroup = $systemConfig->getForm()->getGroup('general', 'locale', 'code');
     $configGroup->setValue('general', 'locale', 'code', $locale);
     $systemConfig->getPageActions()->save();
     $systemConfig->getMessagesBlock()->waitSuccessMessage();
     // Flush cache
     $adminCache->open();
     $adminCache->getActionsBlock()->flushMagentoCache();
     $adminCache->getMessagesBlock()->waitSuccessMessage();
     // Check presents income text on index page
     $cmsIndex->open();
     if ($cmsIndex->getFooterBlock()->isStoreGroupSwitcherVisible() && $cmsIndex->getFooterBlock()->isStoreGroupVisible($store)) {
         $cmsIndex->getFooterBlock()->selectStoreGroup($store);
     }
     $cmsIndex->getStoreSwitcherBlock()->selectStoreView($store->getName());
     \PHPUnit_Framework_Assert::assertTrue($cmsIndex->getSearchBlock()->isPlaceholderContains($welcomeText), "Locale not applied.");
 }
开发者ID:rafaelstz,项目名称:magento2,代码行数:32,代码来源:AssertStoreCanBeLocalized.php


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