Skip to content

Commit 8c24a56

Browse files
committed
MC-21828: Admin: Edit product Attribute
1 parent 05355f1 commit 8c24a56

File tree

28 files changed

+76
-74
lines changed

28 files changed

+76
-74
lines changed

dev/tests/integration/framework/Magento/TestFramework/Eav/Model/ResourceModel/GetEntityIdByAttributeId.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,18 @@ public function __construct(
3939
public function execute(int $setId, int $attributeId, ?int $attributeGroupId = null): ?int
4040
{
4141
$select = $this->attributeSetResource->getConnection()->select()
42-
->from($this->attributeSetResource->getTable('eav_entity_attribute'))
42+
->from(
43+
$this->attributeSetResource->getTable('eav_entity_attribute'),
44+
'entity_attribute_id'
45+
)
4346
->where('attribute_set_id = ?', $setId)
4447
->where('attribute_id = ?', $attributeId);
4548

4649
if ($attributeGroupId !== null) {
4750
$select->where('attribute_group_id = ?', $attributeGroupId);
4851
}
52+
$entityAttributeId = $this->attributeSetResource->getConnection()->fetchOne($select);
4953

50-
$result = $this->attributeSetResource->getConnection()->fetchOne($select);
51-
return $result ? (int)$result : null;
54+
return $entityAttributeId ? (int)$entityAttributeId : null;
5255
}
5356
}

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save/InputType/DecimalTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DecimalTest extends AbstractSaveAttributeTest
2020
/**
2121
* Test create attribute and compare attribute data and input data.
2222
*
23-
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\Decimal::getAttributeDataWithCheckArray()
23+
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\Decimal::getAttributeDataWithCheckArray
2424
*
2525
* @param array $attributePostData
2626
* @param array $checkArray
@@ -34,7 +34,7 @@ public function testCreateAttribute(array $attributePostData, array $checkArray)
3434
/**
3535
* Test create attribute with error.
3636
*
37-
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\Decimal::getAttributeDataWithErrorMessage()
37+
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\Decimal::getAttributeDataWithErrorMessage
3838
*
3939
* @param array $attributePostData
4040
* @param string $errorMessage

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save/InputType/MediaImageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class MediaImageTest extends AbstractSaveAttributeTest
2020
/**
2121
* Test create attribute and compare attribute data and input data.
2222
*
23-
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\MediaImage::getAttributeDataWithCheckArray()
23+
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\MediaImage::getAttributeDataWithCheckArray
2424
*
2525
* @param array $attributePostData
2626
* @param array $checkArray
@@ -34,7 +34,7 @@ public function testCreateAttribute(array $attributePostData, array $checkArray)
3434
/**
3535
* Test create attribute with error.
3636
*
37-
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\MediaImage::getAttributeDataWithErrorMessage()
37+
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\MediaImage::getAttributeDataWithErrorMessage
3838
*
3939
* @param array $attributePostData
4040
* @param string $errorMessage

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Update/AbstractUpdateAttributeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ protected function prepareStoreOptionsExpectedData(array $optionsData): array
253253
$defaultValue = '';
254254

255255
foreach ($optionsData as $optionId => $option) {
256-
if (isset($option['delete']) && $option['delete']) {
256+
if (!empty($option['delete'])) {
257257
continue;
258258
}
259259
$optionsArray[$optionId] = [

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Update/InputType/DecimalTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DecimalTest extends AbstractUpdateAttributeTest
2020
/**
2121
* Test update attribute.
2222
*
23-
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\Decimal::getUpdateProvider()
23+
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\Decimal::getUpdateProvider
2424
* @magentoDataFixture Magento/Catalog/_files/product_decimal_attribute.php
2525
*
2626
* @param array $postData
@@ -36,7 +36,7 @@ public function testUpdateAttribute(array $postData, array $expectedData): void
3636
/**
3737
* Test update attribute with error.
3838
*
39-
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\Decimal::getUpdateProviderWithErrorMessage()
39+
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\Decimal::getUpdateProviderWithErrorMessage
4040
* @magentoDataFixture Magento/Catalog/_files/product_decimal_attribute.php
4141
*
4242
* @param array $postData
@@ -52,7 +52,7 @@ public function testUpdateAttributeWithError(array $postData, string $errorMessa
5252
/**
5353
* Test update attribute frontend labels on stores.
5454
*
55-
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\Decimal::getUpdateFrontendLabelsProvider()
55+
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\Decimal::getUpdateFrontendLabelsProvider
5656
* @magentoDataFixture Magento/Store/_files/second_website_with_two_stores.php
5757
* @magentoDataFixture Magento/Catalog/_files/product_decimal_attribute.php
5858
*

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Update/InputType/MediaImageTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class MediaImageTest extends AbstractUpdateAttributeTest
2020
/**
2121
* Test update attribute.
2222
*
23-
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\MediaImage::getUpdateProvider()
23+
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\MediaImage::getUpdateProvider
2424
* @magentoDataFixture Magento/Catalog/_files/product_image_attribute.php
2525
*
2626
* @param array $postData
@@ -36,7 +36,7 @@ public function testUpdateAttribute(array $postData, array $expectedData): void
3636
/**
3737
* Test update attribute with error.
3838
*
39-
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\MediaImage::getUpdateProviderWithErrorMessage()
39+
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\MediaImage::getUpdateProviderWithErrorMessage
4040
* @magentoDataFixture Magento/Catalog/_files/product_image_attribute.php
4141
*
4242
* @param array $postData
@@ -52,7 +52,7 @@ public function testUpdateAttributeWithError(array $postData, string $errorMessa
5252
/**
5353
* Test update attribute frontend labels on stores.
5454
*
55-
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\MediaImage::getUpdateFrontendLabelsProvider()
55+
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Attribute\DataProvider\MediaImage::getUpdateFrontendLabelsProvider
5656
* @magentoDataFixture Magento/Store/_files/second_website_with_two_stores.php
5757
* @magentoDataFixture Magento/Catalog/_files/product_image_attribute.php
5858
*

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Magento\Framework\Registry;
1111
use Magento\Catalog\Api\ProductAttributeRepositoryInterface;
1212

13-
/* Delete attribute with text_attribute code */
1413
$objectManager = Bootstrap::getObjectManager();
1514
/** @var Registry $registry */
1615
$registry = $objectManager->get(Registry::class);

dev/tests/integration/testsuite/Magento/Eav/Controller/Adminhtml/Product/Attribute/Save/InputType/DateTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DateTest extends AbstractSaveAttributeTest
2020
/**
2121
* Test create attribute and compare attribute data and input data.
2222
*
23-
* @dataProvider \Magento\TestFramework\Eav\Model\Attribute\DataProvider\Date::getAttributeDataWithCheckArray()
23+
* @dataProvider \Magento\TestFramework\Eav\Model\Attribute\DataProvider\Date::getAttributeDataWithCheckArray
2424
*
2525
* @param array $attributePostData
2626
* @param array $checkArray
@@ -34,7 +34,7 @@ public function testCreateAttribute(array $attributePostData, array $checkArray)
3434
/**
3535
* Test create attribute with error.
3636
*
37-
* @dataProvider \Magento\TestFramework\Eav\Model\Attribute\DataProvider\Date::getAttributeDataWithErrorMessage()
37+
* @dataProvider \Magento\TestFramework\Eav\Model\Attribute\DataProvider\Date::getAttributeDataWithErrorMessage
3838
*
3939
* @param array $attributePostData
4040
* @param string $errorMessage

dev/tests/integration/testsuite/Magento/Eav/Controller/Adminhtml/Product/Attribute/Save/InputType/DropDownTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DropDownTest extends AbstractSaveAttributeTest
2020
/**
2121
* Test create attribute and compare attribute data and input data.
2222
*
23-
* @dataProvider \Magento\TestFramework\Eav\Model\Attribute\DataProvider\DropDown::getAttributeDataWithCheckArray()
23+
* @dataProvider \Magento\TestFramework\Eav\Model\Attribute\DataProvider\DropDown::getAttributeDataWithCheckArray
2424
*
2525
* @param array $attributePostData
2626
* @param array $checkArray
@@ -34,7 +34,7 @@ public function testCreateAttribute(array $attributePostData, array $checkArray)
3434
/**
3535
* Test create attribute with error.
3636
*
37-
* @dataProvider \Magento\TestFramework\Eav\Model\Attribute\DataProvider\DropDown::getAttributeDataWithErrorMessage()
37+
* @dataProvider \Magento\TestFramework\Eav\Model\Attribute\DataProvider\DropDown::getAttributeDataWithErrorMessage
3838
*
3939
* @param array $attributePostData
4040
* @param string $errorMessage

dev/tests/integration/testsuite/Magento/Eav/Controller/Adminhtml/Product/Attribute/Save/InputType/MultipleSelectTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class MultipleSelectTest extends AbstractSaveAttributeTest
2020
/**
2121
* Test create attribute and compare attribute data and input data.
2222
*
23-
* @dataProvider \Magento\TestFramework\Eav\Model\Attribute\DataProvider\MultipleSelect::getAttributeDataWithCheckArray()
23+
* @dataProvider \Magento\TestFramework\Eav\Model\Attribute\DataProvider\MultipleSelect::getAttributeDataWithCheckArray
2424
*
2525
* @param array $attributePostData
2626
* @param array $checkArray
@@ -34,7 +34,7 @@ public function testCreateAttribute(array $attributePostData, array $checkArray)
3434
/**
3535
* Test create attribute with error.
3636
*
37-
* @dataProvider \Magento\TestFramework\Eav\Model\Attribute\DataProvider\MultipleSelect::getAttributeDataWithErrorMessage()
37+
* @dataProvider \Magento\TestFramework\Eav\Model\Attribute\DataProvider\MultipleSelect::getAttributeDataWithErrorMessage
3838
*
3939
* @param array $attributePostData
4040
* @param string $errorMessage

0 commit comments

Comments
 (0)