Skip to content

Commit 28ae5c4

Browse files
committed
changes after tests
1 parent 8cfa3cf commit 28ae5c4

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

app/code/Magento/CatalogWidget/Block/Product/ProductsList.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
use Magento\Rule\Model\Condition\Sql\Builder as SqlBuilder;
3232
use Magento\Widget\Block\BlockInterface;
3333
use Magento\Widget\Helper\Conditions;
34+
3435
/**
3536
* Catalog Products List widget block
3637
*
@@ -74,15 +75,11 @@ class ProductsList extends AbstractProduct implements BlockInterface, IdentityIn
7475
protected $httpContext;
7576

7677
/**
77-
* Catalog product visibility
78-
*
7978
* @var Visibility
8079
*/
8180
protected $catalogProductVisibility;
8281

8382
/**
84-
* Product collection factory
85-
*
8683
* @var CollectionFactory
8784
*/
8885
protected $productCollectionFactory;
@@ -337,7 +334,7 @@ public function createCollection()
337334
$collection->setVisibility($this->catalogProductVisibility->getVisibleInCatalogIds());
338335

339336
/**
340-
* Change sorting attribute to entity_id because created_at can be the same for products fastly created
337+
* Change sorting attribute to position because created_at can be the same for products fastly created
341338
* one by one and sorting by created_at is indeterministic in this case.
342339
*/
343340
$collection = $this->_addProductAttributesAndPrices($collection)

app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public function testCreateCollection($pagerEnable, $productsCount, $productsPerP
314314
$collection->expects($this->once())->method('addAttributeToSelect')->willReturnSelf();
315315
$collection->expects($this->once())->method('addUrlRewrite')->willReturnSelf();
316316
$collection->expects($this->once())->method('addStoreFilter')->willReturnSelf();
317-
$collection->expects($this->once())->method('addAttributeToSort')->with('entity_id', 'desc')->willReturnSelf();
317+
$collection->expects($this->once())->method('addAttributeToSort')->with('position', 'asc')->willReturnSelf();
318318
$collection->expects($this->once())->method('setPageSize')->with($expectedPageSize)->willReturnSelf();
319319
$collection->expects($this->once())->method('setCurPage')->willReturnSelf();
320320
$collection->expects($this->once())->method('distinct')->willReturnSelf();

0 commit comments

Comments
 (0)