@@ -89,11 +89,11 @@ protected function setUp(): void
89
89
public function testGetData ()
90
90
{
91
91
$ ruleId = 42 ;
92
- $ ruleData = ['name ' => 'Sales Price Rule ' ];
92
+ $ ruleData = ['name ' => 'Sales Price Rule ' , ' store_labels ' => [ ' 1 ' => ' Store Label ' ] ];
93
93
94
94
$ 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 ' ])
97
97
->disableOriginalConstructor ()
98
98
->getMock ();
99
99
$ this ->collectionMock ->expects ($ this ->once ())->method ('getItems ' )->willReturn ([$ ruleMock ]);
@@ -105,6 +105,7 @@ public function testGetData()
105
105
$ ruleMock ->expects ($ this ->once ())->method ('setDiscountAmount ' )->with (50 )->willReturn ($ ruleMock );
106
106
$ ruleMock ->expects ($ this ->once ())->method ('getDiscountQty ' )->willReturn (20.010 );
107
107
$ ruleMock ->expects ($ this ->once ())->method ('setDiscountQty ' )->with (20.01 )->willReturn ($ ruleMock );
108
+ $ ruleMock ->expects ($ this ->once ())->method ('getStoreLabels ' )->willReturn (["1 " => "Store Label " ]);
108
109
109
110
$ this ->assertEquals ([$ ruleId => $ ruleData ], $ this ->model ->getData ());
110
111
// Load from object-cache the second time
0 commit comments