@@ -108,16 +108,25 @@ public function testSaveLinksDataWithProductsAttrs($linksData)
108
108
$ linksData ['attr_product_ids ' ] = [12 => true , 16 => true ];
109
109
$ linksData ['position ' ] = [4 => 6 ];
110
110
$ linksData ['qty ' ] = [9 => 3 ];
111
+ $ attributes = [
112
+ ['id ' => 1 , 'code ' => 'position ' , 'type ' => 'int ' ],
113
+ ['id ' => 2 , 'code ' => 'qty ' , 'type ' => 'decimal ' ],
114
+ ];
111
115
$ this ->processBehaviorGetter ('append ' );
112
116
$ select = $ this ->createMock (Select::class);
113
- $ this ->connection ->expects ($ this ->any ())->method ('select ' )->will ($ this ->returnValue ($ select ));
114
- $ select ->expects ($ this ->any ())->method ('from ' )->willReturnSelf ();
115
- $ select ->expects ($ this ->any ())->method ('where ' )->willReturnSelf ();
116
- $ this ->connection ->expects ($ this ->once ())->method ('fetchAll ' )->with ($ select )->will ($ this ->returnValue ([]));
117
+ $ this ->connection ->expects ($ this ->exactly (2 ))->method ('select ' )->will ($ this ->returnValue ($ select ));
118
+ $ select ->expects ($ this ->exactly (2 ))->method ('from ' )->willReturnSelf ();
119
+ $ select ->expects ($ this ->exactly (2 ))->method ('where ' )->willReturnSelf ();
120
+ $ this ->connection ->expects ($ this ->once ())->method ('fetchAll ' )
121
+ ->with ($ select )->will ($ this ->returnValue ($ attributes ));
117
122
$ this ->connection ->expects ($ this ->once ())->method ('fetchPairs ' )->with ($ select )->will (
118
123
$ this ->returnValue ([])
119
124
);
120
125
$ this ->connection ->expects ($ this ->exactly (4 ))->method ('insertOnDuplicate ' );
126
+ $ this ->link ->expects ($ this ->exactly (2 ))->method ('getAttributeTypeTable ' )->willReturn (
127
+ 'table_name '
128
+ );
129
+
121
130
$ this ->links ->saveLinksData ($ linksData );
122
131
}
123
132
0 commit comments