@@ -90,7 +90,9 @@ protected function setUp()
90
90
);
91
91
$ attrCollection = $ this ->getMock (
92
92
'\Magento\Eav\Model\Resource\Entity\Attribute\Collection ' ,
93
- [],
93
+ [
94
+ 'addFieldToFilter ' ,
95
+ ],
94
96
[],
95
97
'' ,
96
98
false
@@ -116,6 +118,10 @@ protected function setUp()
116
118
false
117
119
);
118
120
121
+ $ entityAttributes = [
122
+ 'attribute_id ' => 'attributeSetName '
123
+ ];
124
+
119
125
$ this ->entityModel ->expects ($ this ->any ())->method ('getEntityTypeId ' )->willReturn (3 );
120
126
$ this ->entityModel ->expects ($ this ->any ())->method ('getAttributeOptions ' )->willReturn (['option1 ' , 'option2 ' ]);
121
127
$ attrSetColFactory ->expects ($ this ->any ())->method ('create ' )->willReturn ($ attrSetCollection );
@@ -136,7 +142,16 @@ protected function setUp()
136
142
$ attribute ->expects ($ this ->any ())->method ('getDefaultValue ' )->willReturn ('default_value ' );
137
143
$ attribute ->expects ($ this ->any ())->method ('usesSource ' )->willReturn (true );
138
144
$ attribute ->expects ($ this ->any ())->method ('getFrontendInput ' )->willReturn ('multiselect ' );
139
-
145
+ $ attrCollection
146
+ ->expects ($ this ->any ())
147
+ ->method ('addFieldToFilter ' )
148
+ ->with (
149
+ 'main_table.attribute_id ' ,
150
+ ['in ' => [
151
+ key ($ entityAttributes )
152
+ ]]
153
+ )
154
+ ->willReturn ([$ attribute ]);
140
155
141
156
$ this ->connection = $ this ->getMock (
142
157
'Magento\Framework\DB\Adapter\Pdo\Mysql ' ,
@@ -175,7 +190,10 @@ protected function setUp()
175
190
$ this ->connection ->expects ($ this ->any ())->method ('insertOnDuplicate ' )->willReturnSelf ();
176
191
$ this ->connection ->expects ($ this ->any ())->method ('delete ' )->willReturnSelf ();
177
192
$ this ->connection ->expects ($ this ->any ())->method ('quoteInto ' )->willReturn ('' );
178
- $ this ->connection ->expects ($ this ->any ())->method ('fetchPairs ' )->will ($ this ->returnValue ([]));
193
+ $ this ->connection
194
+ ->expects ($ this ->any ())
195
+ ->method ('fetchPairs ' )
196
+ ->will ($ this ->returnValue ($ entityAttributes ));
179
197
180
198
$ this ->resource = $ this ->getMock (
181
199
'\Magento\Framework\App\Resource ' ,
0 commit comments