@@ -122,17 +122,19 @@ public function testGetProcessedTemplate()
122
122
->getArea (Area::AREA_FRONTEND )
123
123
->load ();
124
124
125
- $ this ->setNotDefaultThemeForFixtureStore ();
126
125
$ 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 ());
129
126
$ this ->model ->setDesignConfig ([
130
127
'area ' => 'frontend ' ,
131
128
'store ' => $ this ->objectManager ->get ('Magento\Store\Model\StoreManagerInterface ' )
132
129
->getStore ('fixturestore ' )
133
130
->getId (),
134
131
]);
132
+ $ this ->model ->setTemplateText ('{{view url="Magento_Theme::favicon.ico"}} ' );
135
133
134
+ $ this ->setNotDefaultThemeForFixtureStore ();
135
+ $ this ->assertStringEndsNotWith ($ expectedViewUrl , $ this ->model ->getProcessedTemplate ());
136
+
137
+ $ this ->setDefaultThemeForFixtureStore ();
136
138
$ this ->assertStringEndsWith ($ expectedViewUrl , $ this ->model ->getProcessedTemplate ());
137
139
}
138
140
@@ -529,6 +531,28 @@ protected function setUpThemeFallback($area)
529
531
*/
530
532
protected function setNotDefaultThemeForFixtureStore ()
531
533
{
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 */
532
556
$ theme = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
533
557
'Magento\Framework\View\Design\ThemeInterface '
534
558
);
@@ -554,17 +578,19 @@ public function testGetProcessedTemplateSubject()
554
578
->getArea (Area::AREA_FRONTEND )
555
579
->load ();
556
580
557
- $ this ->setNotDefaultThemeForFixtureStore ();
558
581
$ expectedViewUrl = 'static/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico ' ;
559
582
$ this ->model ->setTemplateSubject ('{{view url="Magento_Theme::favicon.ico"}} ' );
560
- $ this ->assertStringEndsNotWith ($ expectedViewUrl , $ this ->model ->getProcessedTemplateSubject ([]));
561
583
$ this ->model ->setDesignConfig ([
562
584
'area ' => 'frontend ' ,
563
585
'store ' => $ this ->objectManager ->get ('Magento\Store\Model\StoreManagerInterface ' )
564
586
->getStore ('fixturestore ' )
565
587
->getId (),
566
588
]);
567
589
590
+ $ this ->setNotDefaultThemeForFixtureStore ();
591
+ $ this ->assertStringEndsNotWith ($ expectedViewUrl , $ this ->model ->getProcessedTemplateSubject ([]));
592
+
593
+ $ this ->setDefaultThemeForFixtureStore ();
568
594
$ this ->assertStringEndsWith ($ expectedViewUrl , $ this ->model ->getProcessedTemplateSubject ([]));
569
595
}
570
596
0 commit comments