Skip to content

Commit b6b2ad4

Browse files
committed
fixing failed tests
1 parent 6bf4971 commit b6b2ad4

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/ConfiguredPriceTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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())

app/code/Magento/Sales/Test/Unit/Model/OrderTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff 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.'

lib/internal/Magento/Framework/Pricing/Price/AbstractPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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[]

setup/src/Magento/Setup/Model/BatchInsert.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)