Skip to content

Commit 04eb0b4

Browse files
author
Roman Ganin
committed
MAGETWO-38809: Optimize Magento\Framework\View\Element\Template for production mode
- unit tests
1 parent 0022047 commit 04eb0b4

File tree

1 file changed

+28
-1
lines changed
  • app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/Edit

1 file changed

+28
-1
lines changed

app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/Edit/FormTest.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@ class FormTest extends \PHPUnit_Framework_TestCase
130130
*/
131131
protected $block;
132132

133+
/**
134+
* @var \Magento\Framework\View\Element\Template\File\Resolver|\PHPUnit_Framework_MockObject_MockObject
135+
*/
136+
protected $_resolver;
137+
138+
/**
139+
* @var \Magento\Framework\View\Element\Template\File\Validator|\PHPUnit_Framework_MockObject_MockObject
140+
*/
141+
protected $_validator;
142+
133143
/**
134144
* Sets up the fixture, for example, open a network connection.
135145
* This method is called before a test is executed.
@@ -138,6 +148,22 @@ class FormTest extends \PHPUnit_Framework_TestCase
138148
*/
139149
public function setUp()
140150
{
151+
$this->_resolver = $this->getMock(
152+
'Magento\Framework\View\Element\Template\File\Resolver',
153+
[],
154+
[],
155+
'',
156+
false
157+
);
158+
159+
$this->_validator = $this->getMock(
160+
'Magento\Framework\View\Element\Template\File\Validator',
161+
[],
162+
[],
163+
'',
164+
false
165+
);
166+
141167
$this->model = $this->getMock('Magento\Cms\Model\Block', ['getBlockId', 'setStoreId'], [], '', false);
142168

143169
$this->registry = $this->getMock('Magento\Framework\Registry', [], [], '', false);
@@ -193,10 +219,11 @@ public function setUp()
193219
$this->context->expects($this->once())->method('getStoreManager')->willReturn($this->storeManager);
194220
$this->context->expects($this->once())->method('getUrlBuilder')->willReturn($this->urlBuilder);
195221
$this->context->expects($this->once())->method('getAppState')->willReturn($this->appState);
196-
$this->context->expects($this->once())->method('getViewFileSystem')->willReturn($this->viewFileSystem);
197222
$this->context->expects($this->once())->method('getFilesystem')->willReturn($this->fileSystem);
198223
$this->context->expects($this->once())->method('getLogger')->willReturn($this->logger);
199224
$this->context->expects($this->once())->method('getLayout')->willReturn($this->layout);
225+
$this->context->expects($this->once())->method('getResolver')->willReturn($this->_resolver);
226+
$this->context->expects($this->once())->method('getValidator')->willReturn($this->_validator);
200227

201228
/** @var \Magento\Cms\Block\Adminhtml\Block\Edit\Form $block */
202229
$this->block = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))

0 commit comments

Comments
 (0)