Skip to content

Commit e58292e

Browse files
committed
MC-21456: Storefront: Product view in a category
1 parent 9dacb50 commit e58292e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/ProductInCategoriesViewTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ class AbstractTest extends TestCase
5656
/** @var StoreRepositoryInterface */
5757
private $storeRepository;
5858

59+
/** @var LayoutInterface */
60+
private $layout;
61+
5962
/**
6063
* @inheritdoc
6164
*/
@@ -71,6 +74,7 @@ protected function setUp()
7174
$this->categoryLinkManagement = $this->objectManager->create(CategoryLinkManagementInterface::class);
7275
$this->storeManager = $this->objectManager->get(StoreManagerInterface::class);
7376
$this->storeRepository = $this->objectManager->create(StoreRepositoryInterface::class);
77+
$this->layout = $this->objectManager->get(LayoutInterface::class);
7478
}
7579

7680
/**
@@ -121,7 +125,7 @@ public function productDataProvider(): array
121125
* @param array $data
122126
* @return void
123127
*/
124-
public function testCategoryProductVisibilityTest(array $data): void
128+
public function testCategoryProductVisibility(array $data): void
125129
{
126130
$collection = $this->processCategoryViewTest($data['data']['sku'], $data['data']);
127131

@@ -256,7 +260,7 @@ private function processAnchorTest(bool $isAnchor): array
256260
$this->objectManager->removeSharedInstance(Resolver::class);
257261
$this->objectManager->removeSharedInstance(Layer::class);
258262
$this->registerCategory($childCategory);
259-
$newBlock = $this->objectManager->get(LayoutInterface::class)->createBlock(ListProduct::class);
263+
$newBlock = $this->layout->createBlock(ListProduct::class);
260264
$childCategoryCollection = $newBlock->getLoadedProductCollection();
261265

262266
return [

dev/tests/integration/testsuite/Magento/Catalog/_files/category_with_two_products.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
use Magento\Catalog\Api\CategoryLinkManagementInterface;
89
use Magento\TestFramework\Helper\Bootstrap;

0 commit comments

Comments
 (0)