Skip to content

Commit 1eb5b9f

Browse files
MC-42288: Coupon codes for existing cart price rule are not generated
- Update unit test
1 parent c8b282b commit 1eb5b9f

File tree

1 file changed

+5
-0
lines changed
  • app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote

1 file changed

+5
-0
lines changed

app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/GenerateTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public function testExecute()
157157
->method('isAjax')
158158
->willReturn(true);
159159
$ruleMock = $this->getMockBuilder(Rule::class)
160+
->addMethods(['getCouponType'])
161+
->onlyMethods(['getId'])
160162
->disableOriginalConstructor()
161163
->getMock();
162164
$this->registryMock->expects($this->once())
@@ -165,6 +167,9 @@ public function testExecute()
165167
$ruleMock->expects($this->once())
166168
->method('getId')
167169
->willReturn(1);
170+
$ruleMock->expects($this->once())
171+
->method('getCouponType')
172+
->willReturn(\Magento\SalesRule\Model\Rule::COUPON_TYPE_AUTO);
168173
$this->requestMock->expects($this->once())
169174
->method('getParams')
170175
->willReturn($requestData);

0 commit comments

Comments
 (0)