@@ -30,21 +30,11 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase
30
30
*/
31
31
protected $ responseMock ;
32
32
33
- /**
34
- * @var \Magento\Framework\View\Page\Title|\PHPUnit_Framework_MockObject_MockObject
35
- */
36
- protected $ titleMock ;
37
-
38
33
/**
39
34
* @var \PHPUnit_Framework_MockObject_MockObject
40
35
*/
41
36
protected $ resultPageMock ;
42
37
43
- /**
44
- * @var \PHPUnit_Framework_MockObject_MockObject
45
- */
46
- protected $ pageConfigMock ;
47
-
48
38
/**
49
39
* @var \Magento\Sales\Model\Order\Shipment|\PHPUnit_Framework_MockObject_MockObject
50
40
*/
@@ -60,11 +50,6 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase
60
50
*/
61
51
protected $ resultLayoutFactoryMock ;
62
52
63
- /**
64
- * @var \Magento\Framework\View\Result\Layout|\PHPUnit_Framework_MockObject_MockObject
65
- */
66
- protected $ resultLayoutMock ;
67
-
68
53
/**
69
54
* @var \Magento\Framework\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject
70
55
*/
@@ -105,13 +90,6 @@ protected function setUp()
105
90
'' ,
106
91
false
107
92
);
108
- $ this ->titleMock = $ this ->getMock (
109
- 'Magento\Framework\View\Page\Title ' ,
110
- ['prepend ' , '__wakeup ' ],
111
- [],
112
- '' ,
113
- false
114
- );
115
93
$ this ->resultLayoutFactoryMock = $ this ->getMock (
116
94
'Magento\Framework\View\Result\LayoutFactory ' ,
117
95
['create ' ],
@@ -123,9 +101,6 @@ protected function setUp()
123
101
$ this ->resultPageMock = $ this ->getMockBuilder ('Magento\Framework\View\Result\Page ' )
124
102
->disableOriginalConstructor ()
125
103
->getMock ();
126
- $ this ->pageConfigMock = $ this ->getMockBuilder ('Magento\Framework\View\Page\Config ' )
127
- ->disableOriginalConstructor ()
128
- ->getMock ();
129
104
130
105
$ this ->shipmentMock = $ this ->getMock (
131
106
'Magento\Sales\Model\Order\Shipment ' ,
@@ -153,15 +128,9 @@ protected function setUp()
153
128
$ this ->viewInterfaceMock ->expects ($ this ->any ())->method ('getPage ' )->will (
154
129
$ this ->returnValue ($ this ->resultPageMock )
155
130
);
156
- $ this ->resultPageMock ->expects ($ this ->any ())->method ('getConfig ' )->will (
157
- $ this ->returnValue ($ this ->pageConfigMock )
158
- );
159
-
160
- $ this ->pageConfigMock ->expects ($ this ->any ())->method ('getTitle ' )->will ($ this ->returnValue ($ this ->titleMock ));
161
131
162
132
$ contextMock ->expects ($ this ->any ())->method ('getRequest ' )->will ($ this ->returnValue ($ this ->requestMock ));
163
133
$ contextMock ->expects ($ this ->any ())->method ('getResponse ' )->will ($ this ->returnValue ($ this ->responseMock ));
164
- $ contextMock ->expects ($ this ->any ())->method ('getTitle ' )->will ($ this ->returnValue ($ this ->titleMock ));
165
134
$ contextMock ->expects ($ this ->any ())->method ('getView ' )->will ($ this ->returnValue ($ this ->viewInterfaceMock ));
166
135
$ contextMock ->expects ($ this ->any ())
167
136
->method ('getObjectManager ' )
@@ -207,7 +176,7 @@ public function testExecute()
207
176
$ shipment = [];
208
177
$ tracking = [];
209
178
210
- $ this -> resultLayoutMock = $ this ->getMock (
179
+ $ resultLayoutMock = $ this ->getMock (
211
180
'Magento\Framework\View\Result\Layout ' ,
212
181
['getBlock ' , 'getDefaultLayoutHandle ' , 'addDefaultHandle ' , 'getLayout ' ],
213
182
[],
@@ -247,9 +216,9 @@ public function testExecute()
247
216
$ blockMock = $ this ->getMock ('Magento\Shipping\Block\Adminhtml\View\Comments ' , ['toHtml ' ], [], '' , false );
248
217
$ blockMock ->expects ($ this ->once ())->method ('toHtml ' )->willReturn ($ result );
249
218
$ layoutMock ->expects ($ this ->once ())->method ('getBlock ' )->with ('shipment_comments ' )->willReturn ($ blockMock );
250
- $ this -> resultLayoutMock ->expects ($ this ->once ())->method ('getLayout ' )->willReturn ($ layoutMock );
251
- $ this -> resultLayoutMock ->expects ($ this ->once ())->method ('addDefaultHandle ' );
252
- $ this ->resultLayoutFactoryMock ->expects ($ this ->once ())->method ('create ' )->will ($ this ->returnValue ($ this -> resultLayoutMock ));
219
+ $ resultLayoutMock ->expects ($ this ->once ())->method ('getLayout ' )->willReturn ($ layoutMock );
220
+ $ resultLayoutMock ->expects ($ this ->once ())->method ('addDefaultHandle ' );
221
+ $ this ->resultLayoutFactoryMock ->expects ($ this ->once ())->method ('create ' )->will ($ this ->returnValue ($ resultLayoutMock ));
253
222
$ this ->responseMock ->expects ($ this ->once ())->method ('setBody ' )->with ($ result );
254
223
255
224
$ this ->assertNull ($ this ->controller ->execute ());
0 commit comments