File tree Expand file tree Collapse file tree 4 files changed +13
-11
lines changed
GroupedProduct/Test/Unit/Pricing/Price
lib/internal/Magento/Framework/Pricing/Price
setup/src/Magento/Setup/Model Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -219,8 +219,7 @@ public function testGetAmount()
219
219
{
220
220
$ resultPrice = rand (1 , 9 );
221
221
222
- $ this ->price ->expects ($ this ->exactly (4 ))
223
- ->method ('getValue ' )
222
+ $ this ->price ->method ('getValue ' )
224
223
->willReturn ($ resultPrice );
225
224
226
225
$ this ->priceInfo ->expects ($ this ->once ())
Original file line number Diff line number Diff line change @@ -403,9 +403,6 @@ public function testGetCustomerName(array $expectedData)
403
403
$ this ->order ->setCustomerFirstname ($ expectedData ['first_name ' ]);
404
404
$ this ->order ->setCustomerSuffix ($ expectedData ['customer_suffix ' ]);
405
405
$ this ->order ->setCustomerPrefix ($ expectedData ['customer_prefix ' ]);
406
- $ this ->scopeConfigMock ->expects ($ this ->exactly ($ expectedData ['invocation ' ]))
407
- ->method ('isSetFlag ' )
408
- ->willReturn (true );
409
406
$ this ->assertEquals ($ expectedData ['expected_name ' ], $ this ->order ->getCustomerName ());
410
407
}
411
408
@@ -419,7 +416,6 @@ public function customerNameProvider()
419
416
[
420
417
[
421
418
'first_name ' => null ,
422
- 'invocation ' => 0 ,
423
419
'expected_name ' => 'Guest ' ,
424
420
'customer_suffix ' => 'smith ' ,
425
421
'customer_prefix ' => 'mr. '
@@ -428,7 +424,6 @@ public function customerNameProvider()
428
424
[
429
425
[
430
426
'first_name ' => 'Smith ' ,
431
- 'invocation ' => 1 ,
432
427
'expected_name ' => 'mr. Smith Carl ' ,
433
428
'customer_suffix ' => 'Carl ' ,
434
429
'customer_prefix ' => 'mr. '
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ abstract class AbstractPrice implements PriceInterface
24
24
/**
25
25
* Default price type
26
26
*/
27
- const PRICE_CODE = 'abstract_price ' ;
27
+ public const PRICE_CODE = 'abstract_price ' ;
28
28
29
29
/**
30
30
* @var AmountInterface[]
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class BatchInsert
32
32
private $ batchSize ;
33
33
34
34
/**
35
- * @var array
35
+ * @var \SplFixedArray
36
36
*/
37
37
private $ dataStorage ;
38
38
@@ -85,11 +85,19 @@ public function flush()
85
85
$ this ->dataStorage ->setSize ($ this ->currentStorageIndex );
86
86
}
87
87
88
- $ this ->dataStorage ->rewind ();
88
+ if (method_exists ($ this ->dataStorage , 'getIterator ' )) {
89
+ // PHP > 8.0
90
+ $ this ->dataStorage ->getIterator ()->rewind ();
91
+ $ columnsToInsert = array_keys ($ this ->dataStorage ->getIterator ()->current ());
92
+ } else {
93
+ // PHP 7.4. compatibility
94
+ $ this ->dataStorage ->rewind ();
95
+ $ columnsToInsert = array_keys ($ this ->dataStorage ->current ());
96
+ }
89
97
$ this ->getDbConnection ()
90
98
->insertArray (
91
99
$ this ->insertIntoTable ,
92
- array_keys ( $ this -> dataStorage -> current ()) ,
100
+ $ columnsToInsert ,
93
101
$ this ->dataStorage ->toArray ()
94
102
);
95
103
You can’t perform that action at this time.
0 commit comments