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()
219219 {
220220 $ resultPrice = rand (1 , 9 );
221221
222- $ this ->price ->expects ($ this ->exactly (4 ))
223- ->method ('getValue ' )
222+ $ this ->price ->method ('getValue ' )
224223 ->willReturn ($ resultPrice );
225224
226225 $ this ->priceInfo ->expects ($ this ->once ())
Original file line number Diff line number Diff line change @@ -403,9 +403,6 @@ public function testGetCustomerName(array $expectedData)
403403 $ this ->order ->setCustomerFirstname ($ expectedData ['first_name ' ]);
404404 $ this ->order ->setCustomerSuffix ($ expectedData ['customer_suffix ' ]);
405405 $ this ->order ->setCustomerPrefix ($ expectedData ['customer_prefix ' ]);
406- $ this ->scopeConfigMock ->expects ($ this ->exactly ($ expectedData ['invocation ' ]))
407- ->method ('isSetFlag ' )
408- ->willReturn (true );
409406 $ this ->assertEquals ($ expectedData ['expected_name ' ], $ this ->order ->getCustomerName ());
410407 }
411408
@@ -419,7 +416,6 @@ public function customerNameProvider()
419416 [
420417 [
421418 'first_name ' => null ,
422- 'invocation ' => 0 ,
423419 'expected_name ' => 'Guest ' ,
424420 'customer_suffix ' => 'smith ' ,
425421 'customer_prefix ' => 'mr. '
@@ -428,7 +424,6 @@ public function customerNameProvider()
428424 [
429425 [
430426 'first_name ' => 'Smith ' ,
431- 'invocation ' => 1 ,
432427 'expected_name ' => 'mr. Smith Carl ' ,
433428 'customer_suffix ' => 'Carl ' ,
434429 'customer_prefix ' => 'mr. '
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ abstract class AbstractPrice implements PriceInterface
2424 /**
2525 * Default price type
2626 */
27- const PRICE_CODE = 'abstract_price ' ;
27+ public const PRICE_CODE = 'abstract_price ' ;
2828
2929 /**
3030 * @var AmountInterface[]
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class BatchInsert
3232 private $ batchSize ;
3333
3434 /**
35- * @var array
35+ * @var \SplFixedArray
3636 */
3737 private $ dataStorage ;
3838
@@ -85,11 +85,19 @@ public function flush()
8585 $ this ->dataStorage ->setSize ($ this ->currentStorageIndex );
8686 }
8787
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+ }
8997 $ this ->getDbConnection ()
9098 ->insertArray (
9199 $ this ->insertIntoTable ,
92- array_keys ( $ this -> dataStorage -> current ()) ,
100+ $ columnsToInsert ,
93101 $ this ->dataStorage ->toArray ()
94102 );
95103
You can’t perform that action at this time.
0 commit comments