@@ -62,6 +62,11 @@ class EditTest extends \PHPUnit\Framework\TestCase
62
62
*/
63
63
protected $ session ;
64
64
65
+ /**
66
+ * @var \Magento\Catalog\Model\Product\Attribute\Frontend\Inputtype\Presentation|\PHPUnit_Framework_MockObject_MockObject
67
+ */
68
+ protected $ presentation ;
69
+
65
70
/**
66
71
* @var \Magento\Framework\View\Page\Title|\PHPUnit_Framework_MockObject_MockObject
67
72
*/
@@ -128,6 +133,11 @@ protected function setUp()
128
133
->disableOriginalConstructor ()
129
134
->getMock ();
130
135
136
+ $ this ->presentation = $ this ->getMockBuilder (
137
+ \Magento \Catalog \Model \Product \Attribute \Frontend \Inputtype \Presentation::class
138
+ )->disableOriginalConstructor ()
139
+ ->getMock ();
140
+
131
141
$ this ->blockTemplate = $ this ->getMockBuilder (\Magento \Backend \Block \Template::class)
132
142
->setMethods (['setIsPopup ' ])
133
143
->disableOriginalConstructor ()
@@ -169,9 +179,10 @@ public function testExecutePopup()
169
179
->with (\Magento \Catalog \Model \ResourceModel \Eav \Attribute::class)
170
180
->willReturn ($ this ->eavAttribute );
171
181
$ this ->objectManagerMock ->expects ($ this ->any ())->method ('get ' )
172
- ->with (\Magento \Backend \Model \Session::class)
173
- ->willReturn ($ this ->session );
174
-
182
+ ->willReturnMap ([
183
+ [\Magento \Backend \Model \Session::class, $ this ->session ],
184
+ [\Magento \Catalog \Model \Product \Attribute \Frontend \Inputtype \Presentation::class, $ this ->presentation ]
185
+ ]);
175
186
$ this ->eavAttribute ->expects ($ this ->once ())->method ('setEntityTypeId ' )->willReturnSelf ();
176
187
$ this ->eavAttribute ->expects ($ this ->once ())->method ('addData ' )->with ($ attributesData )->willReturnSelf ();
177
188
$ this ->eavAttribute ->expects ($ this ->any ())->method ('getName ' )->willReturn (null );
@@ -219,8 +230,10 @@ public function testExecuteNoPopup()
219
230
->with (\Magento \Catalog \Model \ResourceModel \Eav \Attribute::class)
220
231
->willReturn ($ this ->eavAttribute );
221
232
$ this ->objectManagerMock ->expects ($ this ->any ())->method ('get ' )
222
- ->with (\Magento \Backend \Model \Session::class)
223
- ->willReturn ($ this ->session );
233
+ ->willReturnMap ([
234
+ [\Magento \Backend \Model \Session::class, $ this ->session ],
235
+ [\Magento \Catalog \Model \Product \Attribute \Frontend \Inputtype \Presentation::class, $ this ->presentation ]
236
+ ]);
224
237
225
238
$ this ->eavAttribute ->expects ($ this ->once ())->method ('setEntityTypeId ' )->willReturnSelf ();
226
239
$ this ->eavAttribute ->expects ($ this ->once ())->method ('addData ' )->with ($ attributesData )->willReturnSelf ();
0 commit comments