Skip to content

Commit 8d43eb1

Browse files
committed
ACP2E-3189: fix static and unit test error
1 parent c0e67a3 commit 8d43eb1

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

app/code/Magento/Sales/Model/ResourceModel/Report/Bestsellers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,11 @@ private function getRange(Select $select): array
224224
if (!isset($this->rangesByQuery[$queryHash])) {
225225

226226
$connection = $this->getConnection();
227-
$range = [];
228227
try {
229228
$query = $connection->query($select);
230229
$range = $query->fetchAll(\Zend_Db::FETCH_COLUMN);
231-
} catch (\Exception $e) {
230+
} catch (\Exception) {
231+
$range = [];
232232
}
233233

234234
$this->rangesByQuery[$queryHash] = $range;

app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Report/BestsellersTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,7 @@ public function testAggregateWithMultipleOrderDatesAndNoDates(
358358
$connection->expects($this->any())->method('select')->willReturn($select);
359359
$query = $this->createMock(\Zend_Db_Statement_Interface::class);
360360
$query->expects($this->once())->method('fetchAll')->willReturn($randomDates);
361-
$calls = 3;
362-
if ($from && $to) {
363-
$calls = 4;
364-
}
365-
$connection->expects($this->exactly($calls))->method('query')->willReturn($query);
361+
$connection->expects($this->exactly(3))->method('query')->willReturn($query);
366362
$resource = $this->createMock(ResourceConnection::class);
367363
$resource->expects($this->any())
368364
->method('getConnection')

0 commit comments

Comments
 (0)