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); }
/** * Changes the language * @param string $language * @throws \Behat\Mink\Exception\ElementNotFoundException */ public function setLanguage($language) { $this->selectOption($language); Helper::setCurrentLanguage($language); }