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 1
1
<?php
2
2
/**
3
- *
4
3
* Copyright © Magento, Inc. All rights reserved.
5
4
* See COPYING.txt for license details.
6
5
*/
7
6
namespace Magento \SalesRule \Controller \Adminhtml \Promo \Quote ;
8
7
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
10
15
{
11
16
/**
12
17
* New action html action
@@ -37,7 +42,6 @@ public function execute()
37
42
38
43
if ($ model instanceof \Magento \Rule \Model \Condition \AbstractCondition) {
39
44
$ model ->setJsFormObject ($ formName );
40
- $ model ->setFormName ($ formName );
41
45
$ html = $ model ->asHtmlRecursive ();
42
46
} else {
43
47
$ 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