@@ -177,7 +177,47 @@ public function testGetPriceList(): void
177177 $ this ->selectionCollection ->expects ($ this ->once ())
178178 ->method ('getIterator ' )
179179 ->willReturn (new \ArrayIterator ([]));
180+ $ this ->selectionCollection ->expects ($ this ->once ())
181+ ->method ('setFlag ' )
182+ ->with ('has_stock_status_filter ' , true );
180183
181184 $ this ->model ->getPriceList ($ this ->product , false , false );
182185 }
186+
187+ public function testGetPriceListWithSearchMin (): void
188+ {
189+ $ option = $ this ->createMock (Option::class);
190+ $ option ->expects ($ this ->once ())->method ('getRequired ' )
191+ ->willReturn (true );
192+ $ this ->optionsCollection ->expects ($ this ->any ())
193+ ->method ('getIterator ' )
194+ ->willReturn (new \ArrayIterator ([$ option ]));
195+ $ this ->typeInstance ->expects ($ this ->any ())
196+ ->method ('getOptionsCollection ' )
197+ ->with ($ this ->product )
198+ ->willReturn ($ this ->optionsCollection );
199+ $ this ->product ->expects ($ this ->any ())
200+ ->method ('getTypeInstance ' )
201+ ->willReturn ($ this ->typeInstance );
202+ $ this ->selectionCollection ->expects ($ this ->once ())
203+ ->method ('getFirstItem ' )
204+ ->willReturn ($ this ->createMock (Product::class));
205+ $ this ->typeInstance ->expects ($ this ->once ())
206+ ->method ('getSelectionsCollection ' )
207+ ->willReturn ($ this ->selectionCollection );
208+ $ this ->selectionCollection ->expects ($ this ->once ())
209+ ->method ('setFlag ' )
210+ ->with ('has_stock_status_filter ' , true );
211+ $ this ->selectionCollection ->expects ($ this ->once ())
212+ ->method ('addQuantityFilter ' );
213+ $ this ->product ->expects ($ this ->once ())->method ('isSalable ' )->willReturn (true );
214+ $ this ->optionsCollection ->expects ($ this ->once ())
215+ ->method ('getSize ' )
216+ ->willReturn (1 );
217+ $ this ->optionsCollection ->expects ($ this ->once ())
218+ ->method ('addFilter ' )
219+ ->willReturn ($ this ->optionsCollection );
220+
221+ $ this ->model ->getPriceList ($ this ->product , true , false );
222+ }
183223}
0 commit comments