@@ -207,15 +207,15 @@ public function testCallbackValidateProduct($validate): void
207
207
'updated_at ' => '2014-06-25 14:37:15 '
208
208
];
209
209
$ this ->storeManager ->expects ($ this ->any ())->method ('getWebsites ' )->with (false )
210
- ->willReturn ([$ this ->websiteModel , $ this ->websiteModel ]);
210
+ ->willReturn ([$ this ->websiteModel , $ this ->websiteModel , $ this -> websiteModel ]);
211
211
$ this ->websiteModel
212
212
->method ('getId ' )
213
- ->willReturnOnConsecutiveCalls ('1 ' , '2 ' );
213
+ ->willReturnOnConsecutiveCalls ('1 ' , '2 ' , ' 3 ' );
214
214
$ this ->websiteModel ->expects ($ this ->any ())->method ('getDefaultStore ' )
215
215
->willReturn ($ this ->storeModel );
216
216
$ this ->storeModel
217
217
->method ('getId ' )
218
- ->willReturnOnConsecutiveCalls ('1 ' , '2 ' );
218
+ ->willReturnOnConsecutiveCalls ('1 ' , '2 ' , ' 3 ' );
219
219
$ this ->combineFactory ->expects ($ this ->any ())->method ('create ' )
220
220
->willReturn ($ this ->condition );
221
221
$ this ->condition ->expects ($ this ->any ())->method ('validate ' )
@@ -224,12 +224,14 @@ public function testCallbackValidateProduct($validate): void
224
224
$ this ->productModel ->expects ($ this ->any ())->method ('getId ' )
225
225
->willReturn (1 );
226
226
227
+ $ this ->rule ->setWebsiteIds ('1,2 ' );
227
228
$ this ->rule ->callbackValidateProduct ($ args );
228
229
229
230
$ matchingProducts = $ this ->rule ->getMatchingProductIds ();
230
231
foreach ($ matchingProducts ['1 ' ] as $ matchingRules ) {
231
232
$ this ->assertEquals ($ validate , $ matchingRules );
232
233
}
234
+ $ this ->assertNull ($ matchingProducts ['1 ' ]['3 ' ] ?? null );
233
235
}
234
236
235
237
/**
0 commit comments