Skip to content

Commit dabb907

Browse files
committed
MC-20691: Admin: Update attribute set
1 parent 02438a7 commit dabb907

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Magento\Eav\Model\ResourceModel\Entity\Attribute\Group\Collection;
1616
use Magento\Eav\Model\ResourceModel\Entity\Attribute\Group\CollectionFactory;
1717
use Magento\Framework\App\Request\Http as HttpRequest;
18+
use Magento\Framework\Message\MessageInterface;
1819
use Magento\Framework\Serialize\Serializer\Json;
1920
use Magento\TestFramework\Eav\Model\AttributeSet;
2021
use Magento\TestFramework\TestCase\AbstractBackendController;
@@ -80,6 +81,10 @@ public function testUpdateAttributeSetName(): void
8081
$updateName = 'New attribute set name';
8182
$postData['attribute_set_name'] = $updateName;
8283
$this->performRequest((int)$attributeSet->getAttributeSetId(), $postData);
84+
$this->assertSessionMessages(
85+
$this->equalTo([(string)__('You saved the attribute set.')]),
86+
MessageInterface::TYPE_SUCCESS
87+
);
8388
$updatedAttributeSet = $this->attributeSetRepository->get((int)$attributeSet->getAttributeSetId());
8489
$this->assertEquals($updateName, $updatedAttributeSet->getAttributeSetName());
8590
$updatedAttributeSet->setAttributeSetName($currentAttrSetName);
@@ -110,6 +115,10 @@ public function testUpdateAttributeSetWithNewGroup(): void
110115
$newGroupSortOrder,
111116
];
112117
$this->performRequest($attrSetId, $postData);
118+
$this->assertSessionMessages(
119+
$this->equalTo([(string)__('You saved the attribute set.')]),
120+
MessageInterface::TYPE_SUCCESS
121+
);
113122
$updatedAttrGroups = $this->getAttributeSetGroupCollection($attrSetId)->getItems();
114123
$diffGroups = array_diff_key($updatedAttrGroups, $currentAttrGroups);
115124
$this->assertCount(1, $diffGroups);
@@ -149,6 +158,10 @@ public function testDeleteCustomGroupFromCustomAttributeSet(): void
149158
$customGroup->getAttributeGroupId()
150159
];
151160
$this->performRequest($attrSetId, $postData);
161+
$this->assertSessionMessages(
162+
$this->equalTo([(string)__('You saved the attribute set.')]),
163+
MessageInterface::TYPE_SUCCESS
164+
);
152165
$updatedAttrGroups = $this->getAttributeSetGroupCollection($attrSetId)->getItems();
153166
$diffGroups = array_diff_key($currentAttrGroups, $updatedAttrGroups);
154167
$this->assertCount(1, $diffGroups);

dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav/AttributeSetGroupsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ protected function setUp()
9898
}
9999

100100
/**
101-
* Check that custom group fro custom attribute set not added to product form modifier meta data.
101+
* Check that custom group for custom attribute set not added to product form modifier meta data.
102102
*
103103
* @magentoDataFixture Magento/Catalog/_files/attribute_set_based_on_default_with_custom_group.php
104104
* @magentoDataFixture Magento/Catalog/_files/product_with_test_attribute_set.php

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
use Magento\Catalog\Model\ProductFactory;
1212
use Magento\TestFramework\Eav\Model\AttributeSet;
1313
use Magento\TestFramework\Helper\Bootstrap;
14+
use Magento\Store\Model\StoreManagerInterface;
1415

1516
$objectManager = Bootstrap::getObjectManager();
17+
/** @var StoreManagerInterface $storeManager */
18+
$storeManager = $objectManager->get(StoreManagerInterface::class);
1619
/** @var ProductRepositoryInterface $productRepository */
1720
$productRepository = $objectManager->get(ProductRepositoryInterface::class);
1821
/** @var ProductFactory $productFactory */
@@ -26,6 +29,7 @@
2629
->setId(1)
2730
->setAttributeSetId($customAttributeSet->getAttributeSetId())
2831
->setWebsiteIds([1])
32+
->setStoreId($storeManager->getStore('admin')->getId())
2933
->setName('Simple Product')
3034
->setSku('simple')
3135
->setPrice(10)

0 commit comments

Comments
 (0)