Skip to content

Commit 40026eb

Browse files
author
Bohdan Korablov
committed
Merge remote-tracking branch 'tangoc/MAGETWO-44321' into new_pr_bugs
2 parents 502ba1c + 441e3f4 commit 40026eb

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,19 @@ public function testGetProcessedTemplate()
122122
->getArea(Area::AREA_FRONTEND)
123123
->load();
124124

125-
$this->setNotDefaultThemeForFixtureStore();
126125
$expectedViewUrl = 'static/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico';
127-
$this->model->setTemplateText('{{view url="Magento_Theme::favicon.ico"}}');
128-
$this->assertStringEndsNotWith($expectedViewUrl, $this->model->getProcessedTemplate());
129126
$this->model->setDesignConfig([
130127
'area' => 'frontend',
131128
'store' => $this->objectManager->get('Magento\Store\Model\StoreManagerInterface')
132129
->getStore('fixturestore')
133130
->getId(),
134131
]);
132+
$this->model->setTemplateText('{{view url="Magento_Theme::favicon.ico"}}');
135133

134+
$this->setNotDefaultThemeForFixtureStore();
135+
$this->assertStringEndsNotWith($expectedViewUrl, $this->model->getProcessedTemplate());
136+
137+
$this->setDefaultThemeForFixtureStore();
136138
$this->assertStringEndsWith($expectedViewUrl, $this->model->getProcessedTemplate());
137139
}
138140

@@ -529,6 +531,28 @@ protected function setUpThemeFallback($area)
529531
*/
530532
protected function setNotDefaultThemeForFixtureStore()
531533
{
534+
/** @var \Magento\Framework\View\Design\ThemeInterface $theme */
535+
$theme = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
536+
'Magento\Framework\View\Design\ThemeInterface'
537+
);
538+
$theme->load('Magento/luma', 'theme_path');
539+
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
540+
'Magento\Framework\App\Config\MutableScopeConfigInterface'
541+
)->setValue(
542+
\Magento\Framework\View\DesignInterface::XML_PATH_THEME_ID,
543+
$theme->getId(),
544+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
545+
'fixturestore'
546+
);
547+
}
548+
549+
/**
550+
* Set 'Magento/blank' for the 'fixturestore' store.
551+
* Application isolation is required, if a test uses this method.
552+
*/
553+
protected function setDefaultThemeForFixtureStore()
554+
{
555+
/** @var \Magento\Framework\View\Design\ThemeInterface $theme */
532556
$theme = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
533557
'Magento\Framework\View\Design\ThemeInterface'
534558
);
@@ -554,17 +578,19 @@ public function testGetProcessedTemplateSubject()
554578
->getArea(Area::AREA_FRONTEND)
555579
->load();
556580

557-
$this->setNotDefaultThemeForFixtureStore();
558581
$expectedViewUrl = 'static/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico';
559582
$this->model->setTemplateSubject('{{view url="Magento_Theme::favicon.ico"}}');
560-
$this->assertStringEndsNotWith($expectedViewUrl, $this->model->getProcessedTemplateSubject([]));
561583
$this->model->setDesignConfig([
562584
'area' => 'frontend',
563585
'store' => $this->objectManager->get('Magento\Store\Model\StoreManagerInterface')
564586
->getStore('fixturestore')
565587
->getId(),
566588
]);
567589

590+
$this->setNotDefaultThemeForFixtureStore();
591+
$this->assertStringEndsNotWith($expectedViewUrl, $this->model->getProcessedTemplateSubject([]));
592+
593+
$this->setDefaultThemeForFixtureStore();
568594
$this->assertStringEndsWith($expectedViewUrl, $this->model->getProcessedTemplateSubject([]));
569595
}
570596

0 commit comments

Comments
 (0)