@@ -55,6 +55,7 @@ protected function setUp(): void
55
55
->setMethods ([
56
56
'getPriceInfo ' ,
57
57
'getCustomOption ' ,
58
+ 'getMinimalPrice '
58
59
])
59
60
->getMockForAbstractClass ();
60
61
@@ -100,11 +101,11 @@ public function testGetValue()
100
101
$ wishlistItemOptionMock = $ this ->getMockBuilder (Option::class)
101
102
->disableOriginalConstructor ()
102
103
->getMock ();
103
- $ wishlistItemOptionMock ->expects ($ this ->once ())
104
+ $ wishlistItemOptionMock ->expects ($ this ->atLeastOnce ())
104
105
->method ('getProduct ' )
105
106
->willReturn ($ productMock );
106
107
107
- $ this ->saleableItem ->expects ($ this ->once ())
108
+ $ this ->saleableItem ->expects ($ this ->atLeastOnce ())
108
109
->method ('getCustomOption ' )
109
110
->with ('simple_product ' )
110
111
->willReturn ($ wishlistItemOptionMock );
@@ -116,25 +117,14 @@ public function testGetValueWithNoCustomOption()
116
117
{
117
118
$ priceValue = 100 ;
118
119
119
- $ priceMock = $ this ->getMockBuilder (PriceInterface::class)
120
- ->getMockForAbstractClass ();
121
- $ priceMock ->expects ($ this ->once ())
122
- ->method ('getValue ' )
123
- ->willReturn ($ priceValue );
124
-
125
120
$ this ->saleableItem ->expects ($ this ->once ())
126
121
->method ('getCustomOption ' )
127
122
->with ('simple_product ' )
128
123
->willReturn (null );
129
124
130
125
$ 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 );
138
128
139
129
$ this ->assertEquals (100 , $ this ->model ->getValue ());
140
130
}
0 commit comments