@@ -117,10 +117,11 @@ protected function setUp()
117
117
/**
118
118
* Return the model under test with additional methods mocked.
119
119
*
120
- * @param $mockedMethods array
120
+ * @param array $mockedMethods
121
+ * @param array $data
121
122
* @return \Magento\Email\Model\Template|\PHPUnit_Framework_MockObject_MockObject
122
123
*/
123
- protected function getModelMock (array $ mockedMethods = [])
124
+ protected function getModelMock (array $ mockedMethods = [], array $ data = [] )
124
125
{
125
126
$ helper = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
126
127
return $ this ->getMockForAbstractClass (
@@ -136,7 +137,8 @@ protected function getModelMock(array $mockedMethods = [])
136
137
'scopeConfig ' => $ this ->scopeConfig ,
137
138
'emailConfig ' => $ this ->emailConfig ,
138
139
'filterFactory ' => $ this ->filterFactory ,
139
- 'templateFactory ' => $ this ->templateFactory
140
+ 'templateFactory ' => $ this ->templateFactory ,
141
+ 'data ' => $ data ,
140
142
]
141
143
),
142
144
'' ,
@@ -431,4 +433,17 @@ public function testGetDesignConfig()
431
433
$ expectedConfig = ['area ' => 'test_area ' , 'store ' => 2 ];
432
434
$ this ->assertEquals ($ expectedConfig , $ model ->getDesignConfig ()->getData ());
433
435
}
436
+
437
+ /**
438
+ * @return void
439
+ */
440
+ public function testSetForcedAreaWhenAreIsSet (): void
441
+ {
442
+ $ templateId = 'test_template ' ;
443
+ $ model = $ this ->getModelMock ([], ['area ' => 'frontend ' ]);
444
+
445
+ $ this ->emailConfig ->expects ($ this ->never ())->method ('getTemplateArea ' );
446
+
447
+ $ model ->setForcedArea ($ templateId );
448
+ }
434
449
}
0 commit comments