File tree Expand file tree Collapse file tree 2 files changed +48
-3
lines changed
app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote
dev/tests/integration/testsuite/Magento/SalesRule/Controller/Adminhtml/Promo/Quote Expand file tree Collapse file tree 2 files changed +48
-3
lines changed Original file line number Diff line number Diff line change 11<?php
22/**
3- *
43 * Copyright © Magento, Inc. All rights reserved.
54 * See COPYING.txt for license details.
65 */
76namespace Magento \SalesRule \Controller \Adminhtml \Promo \Quote ;
87
9- class NewActionHtml extends \Magento \SalesRule \Controller \Adminhtml \Promo \Quote
8+ use Magento \Framework \App \Action \HttpPostActionInterface ;
9+ use Magento \SalesRule \Controller \Adminhtml \Promo \Quote ;
10+
11+ /**
12+ * New action html action
13+ */
14+ class NewActionHtml extends Quote implements HttpPostActionInterface
1015{
1116 /**
1217 * New action html action
@@ -37,7 +42,6 @@ public function execute()
3742
3843 if ($ model instanceof \Magento \Rule \Model \Condition \AbstractCondition) {
3944 $ model ->setJsFormObject ($ formName );
40- $ model ->setFormName ($ formName );
4145 $ html = $ model ->asHtmlRecursive ();
4246 } else {
4347 $ html = '' ;
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+ declare (strict_types=1 );
7+
8+ namespace Magento \SalesRule \Controller \Adminhtml \Promo \Quote ;
9+
10+ use Magento \TestFramework \Helper \Bootstrap ;
11+ use Magento \TestFramework \TestCase \AbstractBackendController ;
12+
13+ /**
14+ * New action html test
15+ */
16+ class NewActionHtmlTest extends AbstractBackendController
17+ {
18+ /**
19+ * Test verifies that execute method has the proper data-form-part value in html response
20+ *
21+ * @return void
22+ */
23+ public function testExecute (): void
24+ {
25+ $ formName = 'test_form ' ;
26+ $ this ->getRequest ()->setParams (
27+ [
28+ 'id ' => 1 ,
29+ 'form_namespace ' => $ formName ,
30+ 'type ' => 'Magento\SalesRule\Model\Rule\Condition\Product|quote_item_price ' ,
31+ ]
32+ );
33+ $ objectManager = Bootstrap::getObjectManager ();
34+ /** @var NewActionHtml $controller */
35+ $ controller = $ objectManager ->create (NewActionHtml::class);
36+ $ controller ->execute ();
37+ $ html = $ this ->getResponse ()
38+ ->getBody ();
39+ $ this ->assertContains ($ formName , $ html );
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments