|
6 | 6 |
|
7 | 7 | namespace Magento\Framework\View\Test\Unit\Page\Config\Generator;
|
8 | 8 |
|
9 |
| -use \Magento\Framework\View\Page\Config\Generator\Head; |
10 |
| - |
| 9 | +use Magento\Framework\View\Page\Config\Generator\Head; |
11 | 10 | use Magento\Framework\View\Page\Config as PageConfig;
|
12 | 11 | use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
|
| 12 | +use Magento\Framework\View\Layout\Generator\Context; |
| 13 | +use Magento\Framework\View\Page\Config\Structure; |
| 14 | +use Magento\Framework\View\Layout\Reader\Context as ReaderContext; |
13 | 15 |
|
14 | 16 | /**
|
15 | 17 | * Test for page config generator model
|
@@ -60,20 +62,11 @@ protected function setUp()
|
60 | 62 |
|
61 | 63 | public function testProcess()
|
62 | 64 | {
|
63 |
| - $generatorContextMock = $this->getMockBuilder(\Magento\Framework\View\Layout\Generator\Context::class) |
64 |
| - ->disableOriginalConstructor() |
65 |
| - ->getMock(); |
| 65 | + $generatorContextMock = $this->getMock(Context::class, [], [], '', false); |
66 | 66 | $this->title->expects($this->any())->method('set')->with()->will($this->returnSelf());
|
67 |
| - $structureMock = $this->getMockBuilder(\Magento\Framework\View\Page\Config\Structure::class) |
68 |
| - ->disableOriginalConstructor() |
69 |
| - ->getMock(); |
70 |
| - |
71 |
| - $readerContextMock = $this->getMockBuilder(\Magento\Framework\View\Layout\Reader\Context::class) |
72 |
| - ->disableOriginalConstructor() |
73 |
| - ->getMock(); |
74 |
| - $readerContextMock->expects($this->any()) |
75 |
| - ->method('getPageConfigStructure') |
76 |
| - ->willReturn($structureMock); |
| 67 | + $structureMock = $this->getMock(Structure::class, [], [], '', false); |
| 68 | + $readerContextMock = $this->getMock(ReaderContext::class, [], [], '', false); |
| 69 | + $readerContextMock->expects($this->any())->method('getPageConfigStructure')->willReturn($structureMock); |
77 | 70 |
|
78 | 71 | $structureMock->expects($this->once())->method('processRemoveAssets');
|
79 | 72 | $structureMock->expects($this->once())->method('processRemoveElementAttributes');
|
@@ -158,9 +151,7 @@ public function testProcess()
|
158 | 151 | [PageConfig::ELEMENT_TYPE_HTML, 'html_attr_1', 'html_attr_1']
|
159 | 152 | );
|
160 | 153 |
|
161 |
| - $this->assertEquals( |
162 |
| - $this->headGenerator, |
163 |
| - $this->headGenerator->process($readerContextMock, $generatorContextMock) |
164 |
| - ); |
| 154 | + $result = $this->headGenerator->process($readerContextMock, $generatorContextMock); |
| 155 | + $this->assertEquals($this->headGenerator, $result); |
165 | 156 | }
|
166 | 157 | }
|
0 commit comments