/** * Static method to start boot kernel without leaving local scope in test helper */ public static function start() { $kernel = new self('testing', true); $kernel->boot(); $shopwareBootstrap = $kernel->getShopware()->Bootstrap(); $shopwareBootstrap->Models()->generateAttributeModels(); $shopwareBootstrap->Plugins()->Core()->ErrorHandler()->registerErrorHandler(E_ALL | E_STRICT); /** @var $repository \Shopware\Models\Shop\Repository */ $repository = $shopwareBootstrap->Models()->getRepository('Shopware\\Models\\Shop\\Shop'); $shop = $repository->getActiveDefault(); $shop->registerResources($shopwareBootstrap); $_SERVER['HTTP_HOST'] = $shop->getHost(); }
/** * Static method to start boot kernel without leaving local scope in test helper */ public static function start() { $kernel = new self('testing', true); $kernel->boot(); $shopwareBootstrap = $kernel->getShopware()->Bootstrap(); $shopwareBootstrap->Models()->generateAttributeModels(); $shopwareBootstrap->Plugins()->Core()->ErrorHandler()->registerErrorHandler(E_ALL | E_STRICT); /** @var $repository \Shopware\Models\Shop\Repository */ $repository = $shopwareBootstrap->Models()->getRepository('Shopware\\Models\\Shop\\Shop'); $shop = $repository->getActiveDefault(); $shop->registerResources($shopwareBootstrap); // correct router context for url building $kernel->container->get('router')->setContext(new \Shopware\Components\Routing\Context(Shopware()->Shop()->getHost(), Shopware()->Shop()->getBasePath(), Shopware()->Shop()->getSecure())); $_SERVER['HTTP_HOST'] = $shop->getHost(); }