forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento#14910: [Forwardport] [FIX]: Recent orders are not filtered per store at the customer account page (by @rostyslav-hymon) - magento#14610: CSV files: added possibility to select PHP input file mode (by @enrico69) - magento#14381: [Forwardport] Category\Collection::joinUrlRewrite should use the store set on the collection (by @rostyslav-hymon) Fixed GitHub Issues: - magento#13704: Category\Collection::joinUrlRewrite should use the store set on the collection (reported by @alepane21) has been fixed in magento#14381 by @rostyslav-hymon in 2.3-develop branch Related commits: 1. 29431e9 2. 47c8d54 3. 2a01489 4. 2d12dac 5. 8a097fc 6. af3804a 7. 8220e3f
- Loading branch information
Showing
8 changed files
with
269 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...sts/integration/testsuite/Magento/Catalog/Model/ResourceModel/Category/CollectionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Catalog\Model\ResourceModel\Category; | ||
|
||
class CollectionTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
/** | ||
* @var \Magento\Catalog\Model\ResourceModel\Category\Collection | ||
*/ | ||
private $collection; | ||
|
||
/** | ||
* Sets up the fixture, for example, opens a network connection. | ||
* This method is called before a test is executed. | ||
*/ | ||
protected function setUp() | ||
{ | ||
$this->collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( | ||
\Magento\Catalog\Model\ResourceModel\Category\Collection::class | ||
); | ||
} | ||
|
||
protected function setDown() | ||
{ | ||
/* Refresh stores memory cache after store deletion */ | ||
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( | ||
\Magento\Store\Model\StoreManagerInterface::class | ||
)->reinitStores(); | ||
} | ||
|
||
/** | ||
* @magentoAppIsolation enabled | ||
* @magentoDbIsolation enabled | ||
* @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/category_multiple_stores.php | ||
*/ | ||
public function testJoinUrlRewriteOnDefault() | ||
{ | ||
$categories = $this->collection->joinUrlRewrite()->addPathFilter('1/2/3'); | ||
$this->assertCount(1, $categories); | ||
/** @var $category \Magento\Catalog\Model\Category */ | ||
$category = $categories->getFirstItem(); | ||
$this->assertStringEndsWith('category.html', $category->getUrl()); | ||
} | ||
|
||
/** | ||
* @magentoAppIsolation enabled | ||
* @magentoDbIsolation enabled | ||
* @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/category_multiple_stores.php | ||
*/ | ||
public function testJoinUrlRewriteNotOnDefaultStore() | ||
{ | ||
$store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() | ||
->create(\Magento\Store\Model\Store::class); | ||
$storeId = $store->load('second_category_store', 'code')->getId(); | ||
$categories = $this->collection->setStoreId($storeId)->joinUrlRewrite()->addPathFilter('1/2/3'); | ||
$this->assertCount(1, $categories); | ||
/** @var $category \Magento\Catalog\Model\Category */ | ||
$category = $categories->getFirstItem(); | ||
$this->assertStringEndsWith('category-3-on-2.html', $category->getUrl()); | ||
} | ||
} |
Oops, something went wrong.