Skip to content

Commit eaa9c8b

Browse files
committed
AC-15104::[CE] PHPUnit 12: Upgrade Checkout & Cart Management related test cases
1 parent 305ce5f commit eaa9c8b

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

app/code/Magento/Quote/Test/Unit/Helper/CartExtensionTestHelper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
*/
1515
class CartExtensionTestHelper extends CartExtension
1616
{
17+
/** @var array */
18+
private array $testData = [];
19+
1720
/**
1821
* Set shipping assignments for tests.
1922
*
@@ -22,7 +25,7 @@ class CartExtensionTestHelper extends CartExtension
2225
*/
2326
public function setShippingAssignments($shippingAssignments)
2427
{
25-
$this->setData('shipping_assignments', $shippingAssignments);
28+
$this->testData['shipping_assignments'] = $shippingAssignments;
2629
return $this;
2730
}
2831

@@ -33,6 +36,6 @@ public function setShippingAssignments($shippingAssignments)
3336
*/
3437
public function getShippingAssignments()
3538
{
36-
return $this->getData('shipping_assignments');
39+
return $this->testData['shipping_assignments'] ?? null;
3740
}
3841
}

app/code/Magento/Quote/Test/Unit/Helper/QuoteCollectionTestHelper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
*/
1515
class QuoteCollectionTestHelper extends Collection
1616
{
17+
/** @var array */
18+
private array $testData = [];
19+
1720
/**
1821
* Set quote reference for tests.
1922
*
@@ -22,7 +25,7 @@ class QuoteCollectionTestHelper extends Collection
2225
*/
2326
public function setQuote($quote)
2427
{
25-
$this->setData('quote', $quote);
28+
$this->testData['quote'] = $quote;
2629
return $this;
2730
}
2831
}

app/code/Magento/Quote/Test/Unit/Helper/QuoteTestHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ public function getPriceInclTax()
382382
*
383383
* @return bool
384384
*/
385+
/**
386+
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
387+
*/
388+
// phpcs:ignore Magento2.NamingConvention.PublicMethodName
385389
public function getIsMultiShipping()
386390
{
387391
return (bool)($this->testData['is_multi_shipping'] ?? false);

0 commit comments

Comments
 (0)