Skip to content

Commit 298a243

Browse files
author
Joan He
committed
Merge remote-tracking branch 'arcticfoxes/MC-14990' into 2.3.1-qwerty-pr
2 parents 892188b + cf11dd9 commit 298a243

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

app/code/Magento/Catalog/Model/Product/ProductFrontendAction/Synchronizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private function getProductIdsByActions(array $actions)
143143
$productIds = [];
144144

145145
foreach ($actions as $action) {
146-
if (isset($action['product_id']) && is_int($action['product_id'])) {
146+
if (isset($action['product_id'])) {
147147
$productIds[] = $action['product_id'];
148148
}
149149
}

app/code/Magento/Catalog/Test/Unit/Model/Product/ProductFrontendAction/SynchronizerTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,15 @@ protected function setUp()
8080

8181
public function testFilterProductActions()
8282
{
83+
$typeId = 'recently_compared_product';
8384
$productsData = [
8485
1 => [
8586
'added_at' => 12,
8687
'product_id' => 1,
8788
],
8889
2 => [
8990
'added_at' => 13,
90-
'product_id' => 2,
91+
'product_id' => '2',
9192
],
9293
3 => [
9394
'added_at' => 14,
@@ -126,10 +127,12 @@ public function testFilterProductActions()
126127
$collection->expects($this->once())
127128
->method('addFilterByUserIdentities')
128129
->with(1, 34);
129-
$collection->expects($this->any())
130+
$collection->expects($this->at(1))
130131
->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]);
133136
$iterator = new \IteratorIterator(new \ArrayIterator([$frontendAction]));
134137
$collection->expects($this->once())
135138
->method('getIterator')

0 commit comments

Comments
 (0)