Skip to content

Commit fe3f411

Browse files
author
Serhii Bohomaz
committed
MC-39714: Create automated test for: "Try to add option with unique validation one more time"
1 parent 03fef7e commit fe3f411

File tree

1 file changed

+4
-4
lines changed
  • dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute

1 file changed

+4
-4
lines changed

dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/CreateOptionsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Magento\TestFramework\TestCase\AbstractBackendController;
1515

1616
/**
17-
* Cheks creating attribute options process.
17+
* Checks creating attribute options process.
1818
*
1919
* @see \Magento\ConfigurableProduct\Controller\Adminhtml\Product\Attribute\CreateOptions
2020
* @magentoAppArea adminhtml
@@ -52,21 +52,21 @@ protected function setUp(): void
5252
public function testAddAlreadyAddedOption(): void
5353
{
5454
$this->getRequest()->setMethod(HttpRequest::METHOD_POST);
55-
$attr = $this->attributeRepository->get('test_configurable');
55+
$attribute = $this->attributeRepository->get('test_configurable');
5656
$this->getRequest()->setParams([
5757
'options' => [
5858
[
5959
'label' => 'Option 1',
6060
'is_new' => true,
61-
'attribute_id' => (int)$attr->getAttributeId(),
61+
'attribute_id' => (int)$attribute->getAttributeId(),
6262
],
6363
],
6464
]);
6565
$this->dispatch('backend/catalog/product_attribute/createOptions');
6666
$responseBody = $this->json->unserialize($this->getResponse()->getBody());
6767
$this->assertNotEmpty($responseBody);
6868
$this->assertStringContainsString(
69-
(string)__('The value of attribute ""%1"" must be unique', $attr->getAttributeCode()),
69+
(string)__('The value of attribute ""%1"" must be unique', $attribute->getAttributeCode()),
7070
$responseBody['message']
7171
);
7272
}

0 commit comments

Comments
 (0)