Skip to content

Commit 8783c1a

Browse files
committed
Merge remote-tracking branch 'origin/ACP2E-391' into L3_Arrows_PR_20220221
2 parents b1f87bf + 342a957 commit 8783c1a

File tree

3 files changed

+69
-1
lines changed

3 files changed

+69
-1
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Magento\Catalog\Model\Product\Type;
2525
use Magento\Catalog\Api\ProductRepositoryInterface;
2626
use Magento\Catalog\Model\Category;
27+
use Magento\Catalog\Model\Product\Attribute\Repository as ProductAttributeRepository;
2728

2829
/**
2930
* Test class for Product adminhtml actions
@@ -196,7 +197,6 @@ public function testIndexAction()
196197

197198
/**
198199
* Testing existing product edit page.
199-
*
200200
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
201201
*/
202202
public function testEditAction()
@@ -235,6 +235,22 @@ public function testEditAction()
235235
);
236236
}
237237

238+
/**
239+
* Testing product short description has Wysiwyg after creating category short_description attribute.
240+
* @magentoDataFixture Magento/Catalog/_files/category_custom_short_description_attribute.php
241+
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
242+
*/
243+
public function testProductShortDescriptionHasWysiwygEditor()
244+
{
245+
/** @var ProductRepository $repository */
246+
$repository = $this->repositoryFactory->create();
247+
$product = $repository->get('simple');
248+
$this->dispatch('backend/catalog/product/edit/id/' . $product->getEntityId());
249+
$body = $this->getResponse()->getBody();
250+
$this->assertMatchesRegularExpression('/editorproduct_form_short_description/', $body);
251+
$this->assertMatchesRegularExpression('/buttonsproduct_form_short_description/', $body);
252+
}
253+
238254
/**
239255
* Test create product with already existing url key.
240256
*
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
/** @var Attribute $attribute */
8+
9+
use Magento\Catalog\Model\Category\AttributeFactory;
10+
use Magento\Catalog\Model\Category\Attribute;
11+
use Magento\TestFramework\Helper\Bootstrap;
12+
13+
$attributeFactory = Bootstrap::getObjectManager()->get(AttributeFactory::class);
14+
$attribute = $attributeFactory->create();
15+
$attribute->setAttributeCode('short_description')
16+
->setEntityTypeId(3)
17+
->setBackendType('text')
18+
->setFrontendInput('textarea')
19+
->setIsGlobal(1)
20+
->setIsUserDefined(1);
21+
$attribute->save();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
/** @var Registry $registry */
8+
9+
use Magento\Catalog\Model\Category\AttributeFactory;
10+
use Magento\Framework\Registry;
11+
use Magento\TestFramework\Helper\Bootstrap;
12+
13+
$objectManager = Bootstrap::getObjectManager();
14+
/** @var Registry $registry */
15+
$registry = $objectManager->get(Registry::class);
16+
17+
$registry->unregister('isSecureArea');
18+
$registry->register('isSecureArea', true);
19+
20+
/** @var AttributeFactory $attributeFactory */
21+
$attributeFactory = $objectManager->get(AttributeFactory::class);
22+
$attribute = $attributeFactory->create();
23+
24+
$attribute->loadByCode(3, 'short_description');
25+
26+
if ($attribute->getId()) {
27+
$attribute->delete();
28+
}
29+
30+
$registry->unregister('isSecureArea');
31+
$registry->register('isSecureArea', false);

0 commit comments

Comments
 (0)