Skip to content

Commit 075a64c

Browse files
committed
MAGETWO-90349: Template file 'header.html' is not found.
1 parent f38d3e4 commit 075a64c

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@ protected function setUp()
117117
/**
118118
* Return the model under test with additional methods mocked.
119119
*
120-
* @param $mockedMethods array
120+
* @param array $mockedMethods
121+
* @param array $data
121122
* @return \Magento\Email\Model\Template|\PHPUnit_Framework_MockObject_MockObject
122123
*/
123-
protected function getModelMock(array $mockedMethods = [])
124+
protected function getModelMock(array $mockedMethods = [], array $data = [])
124125
{
125126
$helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
126127
return $this->getMockForAbstractClass(
@@ -136,7 +137,8 @@ protected function getModelMock(array $mockedMethods = [])
136137
'scopeConfig' => $this->scopeConfig,
137138
'emailConfig' => $this->emailConfig,
138139
'filterFactory' => $this->filterFactory,
139-
'templateFactory' => $this->templateFactory
140+
'templateFactory' => $this->templateFactory,
141+
'data' => $data,
140142
]
141143
),
142144
'',
@@ -431,4 +433,17 @@ public function testGetDesignConfig()
431433
$expectedConfig = ['area' => 'test_area', 'store' => 2];
432434
$this->assertEquals($expectedConfig, $model->getDesignConfig()->getData());
433435
}
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+
}
434449
}

0 commit comments

Comments
 (0)