Skip to content

Commit 7ca2d10

Browse files
committed
Merge branch 'MC-11151' into 'MC-18821'
MC-18821: Increase test coverage for Catalog functional area See merge request magn-m23/magn-m23!1646
2 parents c808dbb + 4dda570 commit 7ca2d10

File tree

2 files changed

+6
-28
lines changed

2 files changed

+6
-28
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/SaveTest.php

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ public function testRemoveAttributeFromAttributeSet()
172172
$product->setAttributeSetId($attributeSet->getId());
173173
$product = $this->productRepository->save($product);
174174
$this->dispatch('backend/catalog/product/edit/id/' . $product->getEntityId());
175-
$this->assertNotContains($message, $this->getSyslogContent());
175+
$syslogPath = $this->getSyslogPath();
176+
$syslogContent = file_exists($syslogPath) ? file_get_contents($syslogPath) : '';
177+
$this->assertNotContains($message, $syslogContent);
176178
}
177179

178180
/**
@@ -200,33 +202,9 @@ private function getSyslogPath()
200202
*/
201203
private function removeSyslog()
202204
{
203-
$this->detachLogger();
205+
$this->syslogHandler->close();
204206
if (file_exists($this->getSyslogPath())) {
205207
unlink($this->getSyslogPath());
206208
}
207209
}
208-
209-
/**
210-
* Detach system log handler.
211-
*
212-
* @return void
213-
*/
214-
private function detachLogger()
215-
{
216-
$this->syslogHandler->close();
217-
}
218-
219-
/**
220-
* Retrieve content of system.log file
221-
*
222-
* @return bool|string
223-
*/
224-
private function getSyslogContent()
225-
{
226-
if (!file_exists($this->getSyslogPath())) {
227-
return '';
228-
}
229-
230-
return file_get_contents($this->getSyslogPath());
231-
}
232210
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
$entityType = $objectManager->create(\Magento\Eav\Model\Entity\Type::class)->loadByCode('catalog_product');
1010

1111
$attributeSetCollection = $objectManager->create(
12-
\Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\Collection::class
13-
);
12+
\Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory::class
13+
)->create();
1414
$attributeSetCollection->addFilter('attribute_set_name', 'new_attribute_set');
1515
$attributeSetCollection->addFilter('entity_type_id', $entityType->getId());
1616
$attributeSetCollection->setOrder('attribute_set_id');

0 commit comments

Comments
 (0)