Skip to content

Commit

Permalink
fix phpunit on modern php
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyraul committed Aug 7, 2024
1 parent ffb6e32 commit e5c5674
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v4

Expand Down
1 change: 1 addition & 0 deletions Controller/Adminhtml/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function __construct(
protected function initPage($resultPage)
{
$resultPage->setActiveMenu('Mygento_Base::event');

//->addBreadcrumb(__('Event'), __('Event'));
return $resultPage;
}
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/DiscountHelper/SplitItemsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function testCalculation($order, $expectedArray)
$recalcExpectedItems = array_values($expectedArray['items']);

foreach ($recalcItems as $index => $recalcItem) {
$this->assertEquals($recalcExpectedItems[$index]['price'], $recalcItem['price'], 'Price of item failed');
$this->assertEqualsWithDelta($recalcExpectedItems[$index]['price'], $recalcItem['price'], 0.001, 'Price of item failed');
$this->assertEquals($recalcExpectedItems[$index]['quantity'], $recalcItem['quantity']);
$this->assertEquals($recalcExpectedItems[$index]['sum'], $recalcItem['sum'], 'Sum of item failed');
}
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/DiscountHelper/SpreadAndSplitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testCalculation($order, $expectedArray)
$recalcExpectedItems = array_values($expectedArray['items']);

foreach ($recalcItems as $index => $recalcItem) {
$this->assertEquals($recalcExpectedItems[$index]['price'], $recalcItem['price'], 'Price of item failed');
$this->assertEqualsWithDelta($recalcExpectedItems[$index]['price'], $recalcItem['price'], 0.001, 'Price of item failed');
$this->assertEquals($recalcExpectedItems[$index]['quantity'], $recalcItem['quantity']);
$this->assertEquals($recalcExpectedItems[$index]['sum'], $recalcItem['sum'], 'Sum of item failed');
}
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Facade/AllHandlersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function testCalculation($order, $expected, $virtualOrder = null, $taxVal

foreach ($result->getItems() as $key => $recalcItem) {
$expectedItem = array_shift($expectedItems);
self::assertEquals($expectedItem['price'], $recalcItem->getPrice(), $key . ' Price of item failed');
self::assertEqualsWithDelta($expectedItem['price'], $recalcItem->getPrice(), 0.001, $key . ' Price of item failed');
self::assertEquals($expectedItem['tax'] ?? null, $recalcItem->getTax(), $key . ' Tax of item failed');
self::assertEquals($expectedItem['quantity'], $recalcItem->getQuantity());
self::assertEquals($expectedItem['sum'], $recalcItem->getSum(), $key . ' Sum of item failed');
Expand Down

0 comments on commit e5c5674

Please sign in to comment.