File tree Expand file tree Collapse file tree 3 files changed +68
-1
lines changed
dev/tests/integration/testsuite/Magento/Catalog Expand file tree Collapse file tree 3 files changed +68
-1
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,6 @@ public function testIndexAction()
196
196
197
197
/**
198
198
* Testing existing product edit page.
199
- *
200
199
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
201
200
*/
202
201
public function testEditAction ()
@@ -233,6 +232,22 @@ public function testEditAction()
233
232
),
234
233
'"Save & Duplicate" button isn \'t present on Edit Product page '
235
234
);
235
+ $ this ->assertStringContainsString ('toggleproduct_form_short_description ' , $ body );
236
+ }
237
+
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 testProductShorDescriptionHasWysiwygEditor ()
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 ->assertStringContainsString ('toggleproduct_form_short_description ' , $ body );
236
251
}
237
252
238
253
/**
Original file line number Diff line number Diff line change
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 number Diff line number Diff line change
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 );
You can’t perform that action at this time.
0 commit comments