14
14
class ContextPluginTest extends \PHPUnit \Framework \TestCase
15
15
{
16
16
/**
17
- * @var \Magento\Tax\Helper\Data
17
+ * @var \Magento\Tax\Helper\Data|\PHPUnit_Framework_MockObject_MockObject
18
18
*/
19
19
protected $ taxHelperMock ;
20
20
21
21
/**
22
- * @var \Magento\Weee\Helper\Data
22
+ * @var \Magento\Weee\Helper\Data|\PHPUnit_Framework_MockObject_MockObject
23
23
*/
24
24
protected $ weeeHelperMock ;
25
25
26
26
/**
27
- * @var \Magento\Weee\Model\Tax
27
+ * @var \Magento\Weee\Model\Tax|\PHPUnit_Framework_MockObject_MockObject
28
28
*/
29
29
protected $ weeeTaxMock ;
30
30
31
31
/**
32
- * @var \Magento\Framework\App\Http\Context
32
+ * @var \Magento\Framework\App\Http\Context|\PHPUnit_Framework_MockObject_MockObject
33
33
*/
34
34
protected $ httpContextMock ;
35
35
36
36
/**
37
- * @var \Magento\Tax\Model\Calculation\Proxy
37
+ * @var \Magento\Tax\Model\Calculation\Proxy|\PHPUnit_Framework_MockObject_MockObject
38
38
*/
39
39
protected $ taxCalculationMock ;
40
40
41
41
/**
42
- * @var \Magento\Framework\Module\Manager
42
+ * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject
43
43
*/
44
44
protected $ moduleManagerMock ;
45
45
46
46
/**
47
- * @var \Magento\PageCache\Model\Config
47
+ * @var \Magento\PageCache\Model\Config|\PHPUnit_Framework_MockObject_MockObject
48
48
*/
49
49
protected $ cacheConfigMock ;
50
50
51
51
/**
52
- * @var \Magento\Store\Model\StoreManager
52
+ * @var \Magento\Store\Model\StoreManager|\PHPUnit_Framework_MockObject_MockObject
53
53
*/
54
- protected $ storeManageMock ;
54
+ protected $ storeManagerMock ;
55
55
56
56
/**
57
- * @var \Magento\Framework\App\Config\ScopeConfig
57
+ * @var \Magento\Framework\App\Config|\PHPUnit_Framework_MockObject_MockObject
58
58
*/
59
59
protected $ scopeConfigMock ;
60
60
61
+ /**
62
+ * @var \Magento\Customer\Model\Session|\PHPUnit_Framework_MockObject_MockObject
63
+ */
64
+ private $ customerSessionMock ;
65
+
66
+ /**
67
+ * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
68
+ */
69
+ private $ objectManager ;
70
+
61
71
/**
62
72
* @var \Magento\Tax\Model\App\Action\ContextPlugin
63
73
*/
@@ -98,7 +108,7 @@ protected function setUp()
98
108
$ this ->cacheConfigMock = $ this ->getMockBuilder (\Magento \PageCache \Model \Config::class)
99
109
->disableOriginalConstructor ()
100
110
->getMock ();
101
-
111
+
102
112
$ this ->storeManagerMock = $ this ->getMockBuilder (\Magento \Store \Model \StoreManager::class)
103
113
->disableOriginalConstructor ()
104
114
->getMock ();
@@ -185,10 +195,10 @@ public function testBeforeExecuteBasedOnDefault()
185
195
->method ('setValue ' )
186
196
->with ('weee_tax_region ' , ['countryId ' => 'US ' , 'regionId ' => 0 ], 0 );
187
197
198
+ /** @var \Magento\Framework\App\Test\Unit\Action\Stub\ActionStub $action */
188
199
$ action = $ this ->objectManager ->getObject (\Magento \Framework \App \Test \Unit \Action \Stub \ActionStub::class);
189
- $ request = $ this ->createPartialMock (\Magento \Framework \App \Request \Http::class, ['getActionName ' ]);
190
200
191
- $ this ->contextPlugin ->beforeExecute ($ action, $ request );
201
+ $ this ->contextPlugin ->beforeExecute ($ action );
192
202
}
193
203
194
204
public function testBeforeExecuteBasedOnOrigin ()
@@ -214,10 +224,10 @@ public function testBeforeExecuteBasedOnOrigin()
214
224
->method ('getTaxBasedOn ' )
215
225
->willReturn ('origin ' );
216
226
227
+ /** @var \Magento\Framework\App\Test\Unit\Action\Stub\ActionStub $action */
217
228
$ action = $ this ->objectManager ->getObject (\Magento \Framework \App \Test \Unit \Action \Stub \ActionStub::class);
218
- $ request = $ this ->createPartialMock (\Magento \Framework \App \Request \Http::class, ['getActionName ' ]);
219
229
220
- $ this ->contextPlugin ->beforeExecute ($ action, $ request );
230
+ $ this ->contextPlugin ->beforeExecute ($ action );
221
231
}
222
232
223
233
public function testBeforeExecuteBasedOnBilling ()
@@ -286,10 +296,10 @@ public function testBeforeExecuteBasedOnBilling()
286
296
->method ('setValue ' )
287
297
->with ('weee_tax_region ' , ['countryId ' => 'US ' , 'regionId ' => 1 ], 0 );
288
298
299
+ /** @var \Magento\Framework\App\Test\Unit\Action\Stub\ActionStub $action */
289
300
$ action = $ this ->objectManager ->getObject (\Magento \Framework \App \Test \Unit \Action \Stub \ActionStub::class);
290
- $ request = $ this ->createPartialMock (\Magento \Framework \App \Request \Http::class, ['getActionName ' ]);
291
301
292
- $ this ->contextPlugin ->beforeExecute ($ action, $ request );
302
+ $ this ->contextPlugin ->beforeExecute ($ action );
293
303
}
294
304
295
305
public function testBeforeExecuterBasedOnShipping ()
@@ -358,9 +368,9 @@ public function testBeforeExecuterBasedOnShipping()
358
368
->method ('setValue ' )
359
369
->with ('weee_tax_region ' , ['countryId ' => 'US ' , 'regionId ' => 1 ], 0 );
360
370
371
+ /** @var \Magento\Framework\App\Test\Unit\Action\Stub\ActionStub $action */
361
372
$ action = $ this ->objectManager ->getObject (\Magento \Framework \App \Test \Unit \Action \Stub \ActionStub::class);
362
- $ request = $ this ->createPartialMock (\Magento \Framework \App \Request \Http::class, ['getActionName ' ]);
363
373
364
- $ this ->contextPlugin ->beforeExecute ($ action, $ request );
374
+ $ this ->contextPlugin ->beforeExecute ($ action );
365
375
}
366
376
}
0 commit comments