File tree Expand file tree Collapse file tree 2 files changed +67
-0
lines changed
app/code/Magento/SalesRule
Test/Unit/Model/Rule/Condition Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ public function loadAttributeOptions()
62
62
{
63
63
$ attributes = [
64
64
'base_subtotal_with_discount ' => __ ('Subtotal (Excl. Tax) ' ),
65
+ 'base_subtotal_total_incl_tax ' => __ ('Subtotal (Incl. Tax) ' ),
65
66
'base_subtotal ' => __ ('Subtotal ' ),
66
67
'total_qty ' => __ ('Total Items Quantity ' ),
67
68
'weight ' => __ ('Total Weight ' ),
@@ -99,6 +100,7 @@ public function getInputType()
99
100
{
100
101
switch ($ this ->getAttribute ()) {
101
102
case 'base_subtotal ' :
103
+ case 'base_subtotal_total_incl_tax ' :
102
104
case 'weight ' :
103
105
case 'total_qty ' :
104
106
return 'numeric ' ;
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 \Test \Unit \Model \Rule \Condition ;
9
+
10
+ use Magento \SalesRule \Model \Rule \Condition \Address ;
11
+ use PHPUnit \Framework \TestCase ;
12
+
13
+ /**
14
+ * Test for address rule condition
15
+ */
16
+ class AddressTest extends TestCase
17
+ {
18
+ /**
19
+ * @var Address
20
+ */
21
+ private $ model ;
22
+
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ protected function setUp ()
27
+ {
28
+ parent ::setUp ();
29
+ $ context = $ this ->createMock (\Magento \Rule \Model \Condition \Context::class);
30
+ $ directoryCountry = $ this ->createMock (\Magento \Directory \Model \Config \Source \Country::class);
31
+ $ directoryAllregion = $ this ->createMock (\Magento \Directory \Model \Config \Source \Allregion::class);
32
+ $ shippingAllmethods = $ this ->createMock (\Magento \Shipping \Model \Config \Source \Allmethods::class);
33
+ $ paymentAllmethods = $ this ->createMock (\Magento \Payment \Model \Config \Source \Allmethods::class);
34
+ $ this ->model = new Address (
35
+ $ context ,
36
+ $ directoryCountry ,
37
+ $ directoryAllregion ,
38
+ $ shippingAllmethods ,
39
+ $ paymentAllmethods
40
+ );
41
+ }
42
+
43
+ /**
44
+ * Test that all attributes are present in options list
45
+ */
46
+ public function testLoadAttributeOptions (): void
47
+ {
48
+ $ attributes = [
49
+ 'base_subtotal_with_discount ' ,
50
+ 'base_subtotal_total_incl_tax ' ,
51
+ 'base_subtotal ' ,
52
+ 'total_qty ' ,
53
+ 'weight ' ,
54
+ 'payment_method ' ,
55
+ 'shipping_method ' ,
56
+ 'postcode ' ,
57
+ 'region ' ,
58
+ 'region_id ' ,
59
+ 'country_id ' ,
60
+ ];
61
+
62
+ $ this ->model ->loadAttributeOptions ();
63
+ $ this ->assertEquals ($ attributes , array_keys ($ this ->model ->getAttributeOption ()));
64
+ }
65
+ }
You can’t perform that action at this time.
0 commit comments