本文整理汇总了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");
}
示例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);
}
}
示例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);
}
示例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.");
}
示例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.");
}