@@ -49,7 +49,7 @@ protected function setUp(): void
49
49
->getMock ();
50
50
$ this ->_imageHelperMock = $ this ->createMock (Image::class);
51
51
$ this ->_productMock = $ this ->createMock (Product::class);
52
-
52
+ $ this -> _productMock -> setTypeId (Configurable:: TYPE_CODE );
53
53
$ this ->_model = $ objectManager ->getObject (
54
54
Data::class,
55
55
[
@@ -66,6 +66,10 @@ public function testGetAllowAttributes()
66
66
->method ('getConfigurableAttributes ' )
67
67
->with ($ this ->_productMock );
68
68
69
+ $ this ->_productMock ->expects ($ this ->once ())
70
+ ->method ('getTypeId ' )
71
+ ->willReturn (Configurable::TYPE_CODE );
72
+
69
73
$ this ->_productMock ->expects ($ this ->once ())
70
74
->method ('getTypeInstance ' )
71
75
->willReturn ($ typeInstanceMock );
@@ -119,7 +123,10 @@ public function getOptionsDataProvider()
119
123
{
120
124
$ currentProductMock = $ this ->createPartialMock (
121
125
Product::class,
122
- ['getTypeInstance ' ]
126
+ [
127
+ 'getTypeInstance ' ,
128
+ 'getTypeId '
129
+ ]
123
130
);
124
131
$ provider = [];
125
132
$ provider [] = [
@@ -156,6 +163,9 @@ public function getOptionsDataProvider()
156
163
$ typeInstanceMock ->expects ($ this ->any ())
157
164
->method ('getConfigurableAttributes ' )
158
165
->willReturn ($ attributes );
166
+ $ currentProductMock ->expects ($ this ->any ())
167
+ ->method ('getTypeId ' )
168
+ ->willReturn (Configurable::TYPE_CODE );
159
169
$ currentProductMock ->expects ($ this ->any ())
160
170
->method ('getTypeInstance ' )
161
171
->willReturn ($ typeInstanceMock );
0 commit comments