Skip to content

Commit 32cb0e3

Browse files
committed
Revert changes in test
1 parent 4d464c4 commit 32cb0e3

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

app/code/Magento/MediaContentCatalog/Observer/Category.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function execute(Observer $observer): void
105105
[
106106
self::TYPE => self::CONTENT_TYPE,
107107
self::FIELD => $field,
108-
self::ENTITY_ID => (string) $model->getId(),
108+
self::ENTITY_ID => (string) $id,
109109
]
110110
),
111111
$this->getContent->execute($id, $attribute)

dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTest.php

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
* - general behaviour is tested
2828
*
2929
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
30+
* @see \Magento\Catalog\Model\CategoryTreeTest
31+
* @magentoDataFixture Magento/Catalog/_files/categories.php
32+
* @magentoDbIsolation enabled
33+
* @magentoAppIsolation enabled
3034
*/
3135
class CategoryTest extends TestCase
3236
{
@@ -64,12 +68,14 @@ protected function setUp()
6468
$this->categoryResource = $this->objectManager->get(CategoryResource::class);
6569
$this->categoryRepository = $this->objectManager->get(CategoryRepositoryInterface::class);
6670
}
71+
6772
public function testGetUrlInstance(): void
6873
{
6974
$instance = $this->_model->getUrlInstance();
7075
$this->assertInstanceOf(Url::class, $instance);
7176
$this->assertSame($instance, $this->_model->getUrlInstance());
7277
}
78+
7379
public function testGetTreeModel(): void
7480
{
7581
$model = $this->_model->getTreeModel();
@@ -108,9 +114,6 @@ public function testGetAttributes(): void
108114
$this->assertArrayNotHasKey('custom_design', $attributes);
109115
}
110116

111-
/**
112-
* @magentoDataFixture Magento/Catalog/_files/categories.php
113-
*/
114117
public function testGetProductsPosition(): void
115118
{
116119
$this->assertEquals([], $this->_model->getProductsPosition());
@@ -123,9 +126,6 @@ public function testGetProductsPosition(): void
123126
$this->assertNotEmpty($this->_model->getProductsPosition());
124127
}
125128

126-
/**
127-
* @magentoDataFixture Magento/Catalog/_files/categories.php
128-
*/
129129
public function testGetStoreIds(): void
130130
{
131131
$this->_model = $this->getCategoryByName('Category 1.1');
@@ -218,9 +218,6 @@ public function testGetDesignAttributes(): void
218218
$this->assertContains('custom_design_to', array_keys($attributes));
219219
}
220220

221-
/**
222-
* @magentoDataFixture Magento/Catalog/_files/categories.php
223-
*/
224221
public function testCheckId(): void
225222
{
226223
$this->_model = $this->getCategoryByName('Category 1.1.1');
@@ -235,9 +232,6 @@ public function testVerifyIds(): void
235232
$this->assertNotContains(100, $ids);
236233
}
237234

238-
/**
239-
* @magentoDataFixture Magento/Catalog/_files/categories.php
240-
*/
241235
public function testHasChildren(): void
242236
{
243237
$this->_model->load(3);
@@ -260,9 +254,6 @@ public function testGetName(): void
260254
$this->assertEquals('test', $this->_model->getName());
261255
}
262256

263-
/**
264-
* @magentoDataFixture Magento/Catalog/_files/categories.php
265-
*/
266257
public function testGetProductCount(): void
267258
{
268259
$this->_model->load(6);
@@ -335,7 +326,6 @@ public function testSaveCategoryWithoutImage(): void
335326
}
336327

337328
/**
338-
* @magentoDataFixture Magento/Catalog/_files/categories.php
339329
* @magentoAppArea adminhtml
340330
*/
341331
public function testDeleteChildren(): void
@@ -390,9 +380,6 @@ public function testMissingRequiredAttribute(): void
390380
$this->expectExceptionMessage(
391381
(string)__('The "Name" attribute value is empty. Set the attribute and try again.')
392382
);
393-
394-
$categoryResource = $this->objectManager->create(CategoryResource::class);
395-
$this->_model = $this->objectManager->create(Category::class, ['resource' => $categoryResource]);
396383
$this->_model->setData($data);
397384
$this->_model->validate();
398385
}
@@ -472,9 +459,6 @@ public function testCreateSubcategoryWithMultipleStores(): void
472459
$this->assertEquals($parentSecondStoreKey . '/test-category-100', $childCategorySecondStore->getUrlPath());
473460
}
474461

475-
/*
476-
* @magentoDataFixture Magento/Catalog/_files/categories.php
477-
*/
478462
protected function getCategoryByName($categoryName)
479463
{
480464
/* @var Collection $collection */

0 commit comments

Comments
 (0)