@@ -23,32 +23,32 @@ class DataTest extends \PHPUnit\Framework\TestCase
23
23
/**
24
24
* @var Data
25
25
*/
26
- private $ _helper ;
26
+ private $ helper ;
27
27
28
28
/**
29
29
* @var \PHPUnit_Framework_MockObject_MockObject
30
30
*/
31
- private $ _transportBuilder ;
31
+ private $ transportBuilder ;
32
32
33
33
/**
34
34
* @var \PHPUnit_Framework_MockObject_MockObject
35
35
*/
36
- private $ _translator ;
36
+ private $ translator ;
37
37
38
38
/**
39
39
* @var \PHPUnit_Framework_MockObject_MockObject
40
40
*/
41
- private $ _checkoutSession ;
41
+ private $ checkoutSession ;
42
42
43
43
/**
44
44
* @var \PHPUnit_Framework_MockObject_MockObject
45
45
*/
46
- private $ _scopeConfig ;
46
+ private $ scopeConfig ;
47
47
48
48
/**
49
49
* @var \PHPUnit_Framework_MockObject_MockObject
50
50
*/
51
- private $ _eventManager ;
51
+ private $ eventManager ;
52
52
53
53
/**
54
54
* @inheritdoc
@@ -60,10 +60,10 @@ protected function setUp()
60
60
$ arguments = $ objectManagerHelper ->getConstructArguments ($ className );
61
61
/** @var \Magento\Framework\App\Helper\Context $context */
62
62
$ context = $ arguments ['context ' ];
63
- $ this ->_translator = $ arguments ['inlineTranslation ' ];
64
- $ this ->_eventManager = $ context ->getEventManager ();
65
- $ this ->_scopeConfig = $ context ->getScopeConfig ();
66
- $ this ->_scopeConfig ->expects ($ this ->any ())
63
+ $ this ->translator = $ arguments ['inlineTranslation ' ];
64
+ $ this ->eventManager = $ context ->getEventManager ();
65
+ $ this ->scopeConfig = $ context ->getScopeConfig ();
66
+ $ this ->scopeConfig ->expects ($ this ->any ())
67
67
->method ('getValue ' )
68
68
->willReturnMap (
69
69
[
@@ -118,16 +118,16 @@ protected function setUp()
118
118
]
119
119
);
120
120
121
- $ this ->_checkoutSession = $ arguments ['checkoutSession ' ];
121
+ $ this ->checkoutSession = $ arguments ['checkoutSession ' ];
122
122
$ arguments ['localeDate ' ]->expects ($ this ->any ())
123
123
->method ('formatDateTime ' )
124
124
->willReturn ('Oct 02, 2013 ' );
125
125
126
- $ this ->_transportBuilder = $ arguments ['transportBuilder ' ];
126
+ $ this ->transportBuilder = $ arguments ['transportBuilder ' ];
127
127
128
128
$ this ->priceCurrency = $ arguments ['priceCurrency ' ];
129
129
130
- $ this ->_helper = $ objectManagerHelper ->getObject ($ className , $ arguments );
130
+ $ this ->helper = $ objectManagerHelper ->getObject ($ className , $ arguments );
131
131
}
132
132
133
133
/**
@@ -141,49 +141,49 @@ public function testSendPaymentFailedEmail()
141
141
->getMock ();
142
142
$ quoteMock ->expects ($ this ->any ())->method ('getId ' )->willReturn (1 );
143
143
144
- $ this ->assertSame ($ this ->_helper , $ this ->_helper ->sendPaymentFailedEmail ($ quoteMock , 'test message ' ));
144
+ $ this ->assertSame ($ this ->helper , $ this ->helper ->sendPaymentFailedEmail ($ quoteMock , 'test message ' ));
145
145
}
146
146
147
147
/**
148
148
* @return \PHPUnit_Framework_MockObject_MockObject
149
149
*/
150
150
public function testGetCheckout ()
151
151
{
152
- $ this ->assertEquals ($ this ->_checkoutSession , $ this ->_helper ->getCheckout ());
152
+ $ this ->assertEquals ($ this ->checkoutSession , $ this ->helper ->getCheckout ());
153
153
}
154
154
155
155
public function testGetQuote ()
156
156
{
157
157
$ quoteMock = $ this ->createMock (\Magento \Quote \Model \Quote::class);
158
- $ this ->_checkoutSession ->expects ($ this ->once ())->method ('getQuote ' )->will ($ this ->returnValue ($ quoteMock ));
159
- $ this ->assertEquals ($ quoteMock , $ this ->_helper ->getQuote ());
158
+ $ this ->checkoutSession ->expects ($ this ->once ())->method ('getQuote ' )->will ($ this ->returnValue ($ quoteMock ));
159
+ $ this ->assertEquals ($ quoteMock , $ this ->helper ->getQuote ());
160
160
}
161
161
162
162
public function testFormatPrice ()
163
163
{
164
164
$ price = 5.5 ;
165
165
$ quoteMock = $ this ->createMock (\Magento \Quote \Model \Quote::class);
166
166
$ storeMock = $ this ->createPartialMock (\Magento \Store \Model \Store::class, ['formatPrice ' , '__wakeup ' ]);
167
- $ this ->_checkoutSession ->expects ($ this ->once ())->method ('getQuote ' )->will ($ this ->returnValue ($ quoteMock ));
167
+ $ this ->checkoutSession ->expects ($ this ->once ())->method ('getQuote ' )->will ($ this ->returnValue ($ quoteMock ));
168
168
$ quoteMock ->expects ($ this ->once ())->method ('getStore ' )->will ($ this ->returnValue ($ storeMock ));
169
169
$ this ->priceCurrency ->expects ($ this ->once ())->method ('format ' )->will ($ this ->returnValue ('5.5 ' ));
170
- $ this ->assertEquals ('5.5 ' , $ this ->_helper ->formatPrice ($ price ));
170
+ $ this ->assertEquals ('5.5 ' , $ this ->helper ->formatPrice ($ price ));
171
171
}
172
172
173
173
public function testConvertPrice ()
174
174
{
175
175
$ price = 5.5 ;
176
176
$ this ->priceCurrency ->expects ($ this ->once ())->method ('convertAndFormat ' )->willReturn ($ price );
177
- $ this ->assertEquals (5.5 , $ this ->_helper ->convertPrice ($ price ));
177
+ $ this ->assertEquals (5.5 , $ this ->helper ->convertPrice ($ price ));
178
178
}
179
179
180
180
public function testCanOnepageCheckout ()
181
181
{
182
- $ this ->_scopeConfig ->expects ($ this ->once ())->method ('getValue ' )->with (
182
+ $ this ->scopeConfig ->expects ($ this ->once ())->method ('getValue ' )->with (
183
183
'checkout/options/onepage_checkout_enabled ' ,
184
184
'store '
185
185
)->will ($ this ->returnValue (true ));
186
- $ this ->assertTrue ($ this ->_helper ->canOnepageCheckout ());
186
+ $ this ->assertTrue ($ this ->helper ->canOnepageCheckout ());
187
187
}
188
188
189
189
public function testIsContextCheckout ()
@@ -204,18 +204,18 @@ public function testIsContextCheckout()
204
204
205
205
public function testIsCustomerMustBeLogged ()
206
206
{
207
- $ this ->_scopeConfig ->expects ($ this ->once ())->method ('isSetFlag ' )->with (
207
+ $ this ->scopeConfig ->expects ($ this ->once ())->method ('isSetFlag ' )->with (
208
208
'checkout/options/customer_must_be_logged ' ,
209
209
\Magento \Store \Model \ScopeInterface::SCOPE_STORE
210
210
)->will ($ this ->returnValue (true ));
211
- $ this ->assertTrue ($ this ->_helper ->isCustomerMustBeLogged ());
211
+ $ this ->assertTrue ($ this ->helper ->isCustomerMustBeLogged ());
212
212
}
213
213
214
214
public function testGetPriceInclTax ()
215
215
{
216
216
$ itemMock = $ this ->createPartialMock (\Magento \Framework \DataObject::class, ['getPriceInclTax ' ]);
217
217
$ itemMock ->expects ($ this ->exactly (2 ))->method ('getPriceInclTax ' )->will ($ this ->returnValue (5.5 ));
218
- $ this ->assertEquals (5.5 , $ this ->_helper ->getPriceInclTax ($ itemMock ));
218
+ $ this ->assertEquals (5.5 , $ this ->helper ->getPriceInclTax ($ itemMock ));
219
219
}
220
220
221
221
public function testGetPriceInclTaxWithoutTax ()
@@ -256,7 +256,7 @@ public function testGetSubtotalInclTax()
256
256
$ expected = 5.5 ;
257
257
$ itemMock = $ this ->createPartialMock (\Magento \Framework \DataObject::class, ['getRowTotalInclTax ' ]);
258
258
$ itemMock ->expects ($ this ->exactly (2 ))->method ('getRowTotalInclTax ' )->will ($ this ->returnValue ($ rowTotalInclTax ));
259
- $ this ->assertEquals ($ expected , $ this ->_helper ->getSubtotalInclTax ($ itemMock ));
259
+ $ this ->assertEquals ($ expected , $ this ->helper ->getSubtotalInclTax ($ itemMock ));
260
260
}
261
261
262
262
public function testGetSubtotalInclTaxNegative ()
@@ -274,7 +274,7 @@ public function testGetSubtotalInclTaxNegative()
274
274
$ itemMock ->expects ($ this ->once ())
275
275
->method ('getDiscountTaxCompensation ' )->will ($ this ->returnValue ($ discountTaxCompensation ));
276
276
$ itemMock ->expects ($ this ->once ())->method ('getRowTotal ' )->will ($ this ->returnValue ($ rowTotal ));
277
- $ this ->assertEquals ($ expected , $ this ->_helper ->getSubtotalInclTax ($ itemMock ));
277
+ $ this ->assertEquals ($ expected , $ this ->helper ->getSubtotalInclTax ($ itemMock ));
278
278
}
279
279
280
280
public function testGetBasePriceInclTaxWithoutQty ()
@@ -321,17 +321,17 @@ public function testGetBaseSubtotalInclTax()
321
321
$ itemMock ->expects ($ this ->once ())->method ('getBaseTaxAmount ' );
322
322
$ itemMock ->expects ($ this ->once ())->method ('getBaseDiscountTaxCompensation ' );
323
323
$ itemMock ->expects ($ this ->once ())->method ('getBaseRowTotal ' );
324
- $ this ->_helper ->getBaseSubtotalInclTax ($ itemMock );
324
+ $ this ->helper ->getBaseSubtotalInclTax ($ itemMock );
325
325
}
326
326
327
327
public function testIsAllowedGuestCheckoutWithoutStore ()
328
328
{
329
329
$ quoteMock = $ this ->createMock (\Magento \Quote \Model \Quote::class);
330
330
$ store = null ;
331
331
$ quoteMock ->expects ($ this ->once ())->method ('getStoreId ' )->will ($ this ->returnValue (1 ));
332
- $ this ->_scopeConfig ->expects ($ this ->once ())
332
+ $ this ->scopeConfig ->expects ($ this ->once ())
333
333
->method ('isSetFlag ' )
334
334
->will ($ this ->returnValue (true ));
335
- $ this ->assertTrue ($ this ->_helper ->isAllowedGuestCheckout ($ quoteMock , $ store ));
335
+ $ this ->assertTrue ($ this ->helper ->isAllowedGuestCheckout ($ quoteMock , $ store ));
336
336
}
337
337
}
0 commit comments