本文整理汇总了PHP中Shopware\Tests\Mink\Helper::setCurrentLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::setCurrentLanguage方法的具体用法?PHP Helper::setCurrentLanguage怎么用?PHP Helper::setCurrentLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shopware\Tests\Mink\Helper
的用法示例。
在下文中一共展示了Helper::setCurrentLanguage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare
private function prepare()
{
$em = $this->getService('models');
$em->generateAttributeModels();
//refresh s_core_templates
$this->registerErrorHandler();
$this->getService('theme_installer')->synchronize();
restore_error_handler();
//get the template id
$sql = sprintf('SELECT id FROM `s_core_templates` WHERE template = "%s"', self::$suite->getSetting('template'));
$templateId = $this->getService('db')->fetchOne($sql);
if (!$templateId) {
throw new \RuntimeException(sprintf("Unable to find template by name %s", self::$suite->getSetting('template')));
}
//set the template for shop "Deutsch" and activate SEPA payment method
$sql = <<<EOD
UPDATE `s_core_shops` SET `template_id`= {$templateId} WHERE `id` = 1;
UPDATE `s_core_paymentmeans` SET `active`= 1;
EOD;
$this->getService('db')->exec($sql);
Helper::setCurrentLanguage('de');
/** @var \Shopware\Bundle\PluginInstallerBundle\Service\InstallerService $pluginManager */
$pluginManager = $this->getService('shopware_plugininstaller.plugin_manager');
// hack to prevent behat error handler kicking in.
$this->registerErrorHandler();
$pluginManager->refreshPluginList();
restore_error_handler();
$plugin = $pluginManager->getPluginByName('Notification');
$pluginManager->installPlugin($plugin);
$pluginManager->activatePlugin($plugin);
}
示例2: setLanguage
/**
* Changes the language
* @param string $language
* @throws \Behat\Mink\Exception\ElementNotFoundException
*/
public function setLanguage($language)
{
$this->selectOption($language);
Helper::setCurrentLanguage($language);
}