File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Model/Product/ProductFrontendAction
Test/Unit/Model/Product/ProductFrontendAction Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ private function getProductIdsByActions(array $actions)
143
143
$ productIds = [];
144
144
145
145
foreach ($ actions as $ action ) {
146
- if (isset ($ action ['product_id ' ]) && is_int ( $ action [ ' product_id ' ]) ) {
146
+ if (isset ($ action ['product_id ' ])) {
147
147
$ productIds [] = $ action ['product_id ' ];
148
148
}
149
149
}
Original file line number Diff line number Diff line change @@ -80,14 +80,15 @@ protected function setUp()
80
80
81
81
public function testFilterProductActions ()
82
82
{
83
+ $ typeId = 'recently_compared_product ' ;
83
84
$ productsData = [
84
85
1 => [
85
86
'added_at ' => 12 ,
86
87
'product_id ' => 1 ,
87
88
],
88
89
2 => [
89
90
'added_at ' => 13 ,
90
- 'product_id ' => 2 ,
91
+ 'product_id ' => ' 2 ' ,
91
92
],
92
93
3 => [
93
94
'added_at ' => 14 ,
@@ -126,10 +127,12 @@ public function testFilterProductActions()
126
127
$ collection ->expects ($ this ->once ())
127
128
->method ('addFilterByUserIdentities ' )
128
129
->with (1 , 34 );
129
- $ collection ->expects ($ this ->any ( ))
130
+ $ collection ->expects ($ this ->at ( 1 ))
130
131
->method ('addFieldToFilter ' )
131
- ->withConsecutive (['type_id ' ], ['product_id ' ]);
132
-
132
+ ->with ('type_id ' , $ typeId );
133
+ $ collection ->expects ($ this ->at (2 ))
134
+ ->method ('addFieldToFilter ' )
135
+ ->with ('product_id ' , [1 , 2 ]);
133
136
$ iterator = new \IteratorIterator (new \ArrayIterator ([$ frontendAction ]));
134
137
$ collection ->expects ($ this ->once ())
135
138
->method ('getIterator ' )
You can’t perform that action at this time.
0 commit comments