@@ -55,6 +55,7 @@ protected function setUp(): void
5555 ->setMethods ([
5656 'getPriceInfo ' ,
5757 'getCustomOption ' ,
58+ 'getMinimalPrice '
5859 ])
5960 ->getMockForAbstractClass ();
6061
@@ -100,11 +101,11 @@ public function testGetValue()
100101 $ wishlistItemOptionMock = $ this ->getMockBuilder (Option::class)
101102 ->disableOriginalConstructor ()
102103 ->getMock ();
103- $ wishlistItemOptionMock ->expects ($ this ->once ())
104+ $ wishlistItemOptionMock ->expects ($ this ->atLeastOnce ())
104105 ->method ('getProduct ' )
105106 ->willReturn ($ productMock );
106107
107- $ this ->saleableItem ->expects ($ this ->once ())
108+ $ this ->saleableItem ->expects ($ this ->atLeastOnce ())
108109 ->method ('getCustomOption ' )
109110 ->with ('simple_product ' )
110111 ->willReturn ($ wishlistItemOptionMock );
@@ -116,25 +117,14 @@ public function testGetValueWithNoCustomOption()
116117 {
117118 $ priceValue = 100 ;
118119
119- $ priceMock = $ this ->getMockBuilder (PriceInterface::class)
120- ->getMockForAbstractClass ();
121- $ priceMock ->expects ($ this ->once ())
122- ->method ('getValue ' )
123- ->willReturn ($ priceValue );
124-
125120 $ this ->saleableItem ->expects ($ this ->once ())
126121 ->method ('getCustomOption ' )
127122 ->with ('simple_product ' )
128123 ->willReturn (null );
129124
130125 $ this ->saleableItem ->expects ($ this ->once ())
131- ->method ('getPriceInfo ' )
132- ->willReturn ($ this ->priceInfoMock );
133-
134- $ this ->priceInfoMock ->expects ($ this ->once ())
135- ->method ('getPrice ' )
136- ->with (ConfigurableProduct::PRICE_CODE )
137- ->willReturn ($ priceMock );
126+ ->method ('getMinimalPrice ' )
127+ ->willReturn (100 );
138128
139129 $ this ->assertEquals (100 , $ this ->model ->getValue ());
140130 }
0 commit comments