Skip to content

Commit 650468b

Browse files
committed
ACP2E-1923: Cart Price Rules > Store View Specific Labels are being removed after Schedule updates
1 parent ae6d3fc commit 650468b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/code/Magento/SalesRule/Test/Unit/Model/Rule/DataProviderTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ protected function setUp(): void
8989
public function testGetData()
9090
{
9191
$ruleId = 42;
92-
$ruleData = ['name' => 'Sales Price Rule'];
92+
$ruleData = ['name' => 'Sales Price Rule', 'store_labels' => ['1' => 'Store Label']];
9393

9494
$ruleMock = $this->getMockBuilder(Rule::class)
95-
->addMethods(['getDiscountAmount', 'setDiscountAmount', 'getDiscountQty', 'setDiscountQty'])
96-
->onlyMethods(['load', 'getId', 'getData'])
95+
->addMethods(['getDiscountAmount', 'setDiscountAmount', 'getDiscountQty', 'setDiscountQty',])
96+
->onlyMethods(['load', 'getId', 'getData', 'getStoreLabels'])
9797
->disableOriginalConstructor()
9898
->getMock();
9999
$this->collectionMock->expects($this->once())->method('getItems')->willReturn([$ruleMock]);
@@ -105,6 +105,7 @@ public function testGetData()
105105
$ruleMock->expects($this->once())->method('setDiscountAmount')->with(50)->willReturn($ruleMock);
106106
$ruleMock->expects($this->once())->method('getDiscountQty')->willReturn(20.010);
107107
$ruleMock->expects($this->once())->method('setDiscountQty')->with(20.01)->willReturn($ruleMock);
108+
$ruleMock->expects($this->once())->method('getStoreLabels')->willReturn(["1" => "Store Label"]);
108109

109110
$this->assertEquals([$ruleId => $ruleData], $this->model->getData());
110111
// Load from object-cache the second time

0 commit comments

Comments
 (0)