@@ -50,7 +50,7 @@ class DetailsTest extends TestCase
50
50
/** @var \Magento\Store\Model\StoreManagement|MockObject */
51
51
protected $ storeManagerMock ;
52
52
53
- public function setUp ()
53
+ public function setUp (): void
54
54
{
55
55
parent ::setUp ();
56
56
@@ -62,7 +62,7 @@ public function setUp()
62
62
$ this ->contextMock = $ this ->createMock (Context::class);
63
63
64
64
$ this ->contextMock
65
- ->expects ($ this -> atLeastOnce ())
65
+ ->expects (self :: atLeastOnce ())
66
66
->method ('getStoreManager ' )
67
67
->willReturn ($ this ->storeManagerMock );
68
68
@@ -95,14 +95,14 @@ public function testSetSaleableItem(): void
95
95
->disableOriginalConstructor ()
96
96
->getMockForAbstractClass ();
97
97
$ this ->sut ->setSaleableItem ($ saleableItemMock );
98
- $ this -> assertNull ($ this ->sut ->getData ('tax_rate ' ));
98
+ self :: assertNull ($ this ->sut ->getData ('tax_rate ' ));
99
99
}
100
100
101
101
public function testGetFormattedTaxRate (): void
102
102
{
103
103
$ this ->sut ->setData ('tax_rate ' , '19 ' );
104
104
$ expected = new Phrase ('%1% ' , ['19 ' ]);
105
- $ this -> assertEquals ($ expected , $ this ->sut ->getFormattedTaxRate ());
105
+ self :: assertEquals ($ expected , $ this ->sut ->getFormattedTaxRate ());
106
106
}
107
107
108
108
public function testGetFormattedTaxRateIsZero (): void
@@ -112,13 +112,13 @@ public function testGetFormattedTaxRateIsZero(): void
112
112
->disableOriginalConstructor ()
113
113
->getMockForAbstractClass ();
114
114
$ saleableItemMock
115
- ->expects ($ this -> at (0 ))
115
+ ->expects (self :: at (0 ))
116
116
->method ('getTaxPercent ' )
117
117
->willReturn (7 );
118
118
119
119
$ this ->sut ->setSaleableItem ($ saleableItemMock );
120
120
$ expected = new Phrase ('%1% ' , ['7 ' ]);
121
- $ this -> assertEquals ($ expected , $ this ->sut ->getFormattedTaxRate ());
121
+ self :: assertEquals ($ expected , $ this ->sut ->getFormattedTaxRate ());
122
122
}
123
123
124
124
public function testGetFormattedTaxRateIsFive (): void
@@ -128,12 +128,12 @@ public function testGetFormattedTaxRateIsFive(): void
128
128
->disableOriginalConstructor ()
129
129
->getMockForAbstractClass ();
130
130
$ saleableItem2Mock
131
- ->expects ($ this -> at (0 ))
131
+ ->expects (self :: at (0 ))
132
132
->method ('getTaxPercent ' )
133
133
->willReturn (null );
134
134
135
135
$ saleableItem2Mock
136
- ->expects ($ this -> at (1 ))
136
+ ->expects (self :: at (1 ))
137
137
->method ('getTaxClassId ' )
138
138
->willReturn ('simple ' );
139
139
@@ -142,81 +142,81 @@ public function testGetFormattedTaxRateIsFive(): void
142
142
->getMockForAbstractClass ();
143
143
144
144
$ this ->storeManagerMock
145
- ->expects ($ this -> at (0 ))
145
+ ->expects (self :: at (0 ))
146
146
->method ('getStore ' )
147
147
->willReturn ($ storeMock );
148
148
149
149
$ this ->customerSessionMock
150
- ->expects ($ this -> at (0 ))
150
+ ->expects (self :: at (0 ))
151
151
->method ('getCustomerGroupId ' )
152
152
->willReturn (10 );
153
153
$ groupMock = $ this ->createMock (\Magento \Customer \Model \Data \Group::class);
154
154
155
155
$ groupMock
156
- ->expects ($ this -> at (0 ))
156
+ ->expects (self :: at (0 ))
157
157
->method ('getTaxClassId ' )
158
158
->willReturn (20 );
159
159
160
160
$ this ->groupRepositoryMock
161
- ->expects ($ this -> at (0 ))
161
+ ->expects (self :: at (0 ))
162
162
->method ('getById ' )
163
163
->withAnyParameters (10 )
164
164
->willReturn ($ groupMock );
165
165
166
166
$ dataMock = $ this ->createMock (\Magento \Framework \DataObject::class);
167
167
168
168
$ dataMock
169
- ->expects ($ this -> at (0 ))
169
+ ->expects (self :: at (0 ))
170
170
->method ('setData ' )
171
171
->willReturn ($ dataMock );
172
172
173
173
$ this ->taxCalculationMock
174
- ->expects ($ this -> at (0 ))
174
+ ->expects (self :: at (0 ))
175
175
->method ('getRateRequest ' )
176
176
->willReturn ($ dataMock );
177
177
178
178
$ this ->taxCalculationMock
179
- ->expects ($ this -> at (1 ))
179
+ ->expects (self :: at (1 ))
180
180
->method ('getRate ' )
181
181
->willReturn (5 );
182
182
183
183
$ this ->sut ->setSaleableItem ($ saleableItem2Mock );
184
184
$ expected = new Phrase ('%1% ' , ['5 ' ]);
185
- $ this -> assertEquals ($ expected , $ this ->sut ->getFormattedTaxRate ());
185
+ self :: assertEquals ($ expected , $ this ->sut ->getFormattedTaxRate ());
186
186
}
187
187
188
188
public function testGetPriceDisplayType (): void
189
189
{
190
190
$ this ->taxHelperMock
191
- ->expects ($ this -> at (0 ))
191
+ ->expects (self :: at (0 ))
192
192
->method ('getPriceDisplayType ' )
193
193
->willReturn (4 );
194
- $ this -> assertSame (4 , $ this ->sut ->getPriceDisplayType ());
194
+ self :: assertSame (4 , $ this ->sut ->getPriceDisplayType ());
195
195
}
196
196
197
197
public function testIsIncludingShippingCosts (): void
198
198
{
199
- $ this -> assertFalse ($ this ->sut ->isIncludingShippingCosts ());
199
+ self :: assertFalse ($ this ->sut ->isIncludingShippingCosts ());
200
200
201
201
$ this ->sut ->setData ('is_including_shipping_costs ' , null );
202
- $ this -> assertFalse ($ this ->sut ->isIncludingShippingCosts ());
202
+ self :: assertFalse ($ this ->sut ->isIncludingShippingCosts ());
203
203
204
204
$ this ->sut ->setData ('is_including_shipping_costs ' , 1 );
205
- $ this -> assertTrue ($ this ->sut ->isIncludingShippingCosts ());
205
+ self :: assertTrue ($ this ->sut ->isIncludingShippingCosts ());
206
206
207
207
$ this ->sut ->unsetData ('is_including_shipping_costs ' );
208
208
$ this ->magesetupConfigMock
209
- ->expects ($ this -> at (0 ))
209
+ ->expects (self :: at (0 ))
210
210
->method ('isIncludingShippingCosts ' )
211
211
->willReturn (false );
212
- $ this -> assertFalse ($ this ->sut ->isIncludingShippingCosts ());
212
+ self :: assertFalse ($ this ->sut ->isIncludingShippingCosts ());
213
213
214
214
$ this ->sut ->unsetData ('is_including_shipping_costs ' );
215
215
$ this ->magesetupConfigMock
216
- ->expects ($ this -> at (0 ))
216
+ ->expects (self :: at (0 ))
217
217
->method ('isIncludingShippingCosts ' )
218
218
->willReturn (true );
219
- $ this -> assertTrue ($ this ->sut ->isIncludingShippingCosts ());
219
+ self :: assertTrue ($ this ->sut ->isIncludingShippingCosts ());
220
220
}
221
221
222
222
public function testCanShowShippingLink (): void
@@ -226,29 +226,29 @@ public function testCanShowShippingLink(): void
226
226
->disableOriginalConstructor ()
227
227
->getMockForAbstractClass ();
228
228
$ saleableItemMock
229
- ->expects ($ this -> at (0 ))
229
+ ->expects (self :: at (0 ))
230
230
->method ('getTypeId ' )
231
231
->willReturn ('virtual ' );
232
232
233
233
$ this ->sut ->setSaleableItem ($ saleableItemMock );
234
- $ this -> assertFalse ($ this ->sut ->canShowShippingLink ());
234
+ self :: assertFalse ($ this ->sut ->canShowShippingLink ());
235
235
236
236
$ saleableItemMock
237
- ->expects ($ this -> at (0 ))
237
+ ->expects (self :: at (0 ))
238
238
->method ('getTypeId ' )
239
239
->willReturn ('configurable ' );
240
240
241
241
$ this ->sut ->setSaleableItem ($ saleableItemMock );
242
- $ this -> assertTrue ($ this ->sut ->canShowShippingLink ());
242
+ self :: assertTrue ($ this ->sut ->canShowShippingLink ());
243
243
}
244
244
245
245
public function testGetShippingCostUrl ()
246
246
{
247
247
$ shippingCostUrl = "http://shop.firegento.com/shipping " ;
248
248
$ this ->magesetupConfigMock
249
- ->expects ($ this -> at (0 ))
249
+ ->expects (self :: at (0 ))
250
250
->method ('getShippingCostUrl ' )
251
251
->willReturn ($ shippingCostUrl );
252
- $ this -> assertSame ($ shippingCostUrl , $ this ->sut ->getShippingCostUrl ());
252
+ self :: assertSame ($ shippingCostUrl , $ this ->sut ->getShippingCostUrl ());
253
253
}
254
254
}
0 commit comments