Skip to content

Commit 031c7fd

Browse files
committed
MC-33069: Stabilize Unit tests
1 parent 431a535 commit 031c7fd

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

app/code/Magento/SalesRule/Test/Unit/Model/ResourceModel/Report/CollectionTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,7 @@ public function testApplyRulesFilterWithRulesList()
177177

178178
$this->selectMock->expects($this->at(3))
179179
->method('where')
180-
->with(implode([
181-
'test_1',
182-
'test_2',
183-
], ' OR '));
180+
->with(implode(' OR ', ['test_1', 'test_2']));
184181

185182
$ruleMock = $this->getRuleMock();
186183
$ruleMock->expects($this->once())

app/code/Magento/SalesRule/Test/Unit/Model/Rule/Action/Discount/CartFixedTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ protected function setUp(): void
118118
*/
119119
public function testCalculate()
120120
{
121+
$ruleItemTotals = [
122+
'items_price' => 100,
123+
'base_items_price' => 100,
124+
'items_count' => 1,
125+
];
126+
121127
$this->rule->setData(['id' => 1, 'discount_amount' => 10.0]);
122128

123129
$this->quote->expects($this->any())->method('getCartFixedRules')->willReturn([]);
@@ -126,6 +132,11 @@ public function testCalculate()
126132
$this->priceCurrency->expects($this->atLeastOnce())->method('round')->willReturnArgument(0);
127133
$this->quote->expects($this->any())->method('getStore')->willReturn($store);
128134

135+
$this->validator->expects($this->once())
136+
->method('getRuleItemTotalsInfo')
137+
->with($this->rule->getId())
138+
->willReturn($ruleItemTotals);
139+
129140
/** validators data */
130141
$this->validator->expects(
131142
$this->once()

0 commit comments

Comments
 (0)