Skip to content

Commit 78b77f4

Browse files
ACPT-1552: Clean up skip-list for GraphQlState Test
Adding _resetState to Quote Total classes
1 parent 264ae06 commit 78b77f4

File tree

5 files changed

+49
-6
lines changed

5 files changed

+49
-6
lines changed

app/code/Magento/Quote/Model/Quote/Address/Total/AbstractTotal.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Quote\Model\Quote\Address\Total;
77

8+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
9+
810
/**
911
* Sales Quote Address Total abstract model
1012
*
@@ -13,7 +15,7 @@
1315
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
1416
* @since 100.0.2
1517
*/
16-
abstract class AbstractTotal implements CollectorInterface, ReaderInterface
18+
abstract class AbstractTotal implements CollectorInterface, ReaderInterface, ResetAfterRequestInterface
1719
{
1820
/**
1921
* Total Code name
@@ -48,6 +50,24 @@ abstract class AbstractTotal implements CollectorInterface, ReaderInterface
4850
*/
4951
protected $_itemRowTotalKey = null;
5052

53+
/**
54+
* @var \Magento\Quote\Model\Quote\Address\Total
55+
*/
56+
protected $total;
57+
58+
/**
59+
* @inheritDoc
60+
*/
61+
public function _resetState(): void
62+
{
63+
$this->_code = null;
64+
$this->_address = null;
65+
$this->_canAddAmountToAddress = true;
66+
$this->_canSetAddressAmount = true;
67+
$this->_itemRowTotalKey = null;
68+
$this->total = null;
69+
}
70+
5171
/**
5272
* Set total code code name
5373
*
@@ -142,11 +162,6 @@ protected function _getAddress()
142162
return $this->_address;
143163
}
144164

145-
/**
146-
* @var \Magento\Quote\Model\Quote\Address\Total
147-
*/
148-
protected $total;
149-
150165
/**
151166
* @param \Magento\Quote\Model\Quote\Address\Total $total
152167
* @return $this

app/code/Magento/Quote/Model/Quote/Address/Total/Shipping.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ public function __construct(
4040
$this->setCode('shipping');
4141
}
4242

43+
/**
44+
* @inheritDoc
45+
*/
46+
public function _resetState(): void
47+
{
48+
parent::_resetState();
49+
$this->setCode('shipping');
50+
}
51+
4352
/**
4453
* Collect totals information about shipping
4554
*

app/code/Magento/Quote/Model/ResourceModel/Quote.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function __construct(
3535
Manager $sequenceManager,
3636
$connectionName = null
3737
) {
38+
$this->_uniqueFields = [];
3839
parent::__construct($context, $entitySnapshot, $entityRelationComposite, $connectionName);
3940
$this->sequenceManager = $sequenceManager;
4041
}

app/code/Magento/SalesRule/Model/Quote/Discount.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ public function __construct(
109109
?: ObjectManager::getInstance()->get(RulesApplier::class);
110110
}
111111

112+
/**
113+
* @inheritDoc
114+
*/
115+
public function _resetState(): void
116+
{
117+
parent::_resetState();
118+
$this->setCode(self::COLLECTOR_TYPE_CODE);
119+
}
120+
112121
/**
113122
* Collect address discount amount
114123
*

app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ public function __construct(
9191
);
9292
}
9393

94+
/**
95+
* @inheritDoc
96+
*/
97+
public function _resetState(): void
98+
{
99+
parent::_resetState();
100+
$this->setCode('tax');
101+
}
102+
94103
/**
95104
* Collect tax totals for quote address
96105
*

0 commit comments

Comments
 (0)