Skip to content

Commit a9fc95a

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

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

app/code/Magento/Catalog/Test/Unit/Helper/ProductTestHelper.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ class ProductTestHelper extends Product
2323
*/
2424
private $data = [];
2525

26-
/** @var int */
27-
private $id;
28-
2926
/** @var DataObject|null */
3027
private $urlDataObject;
3128

@@ -56,10 +53,8 @@ class ProductTestHelper extends Product
5653
* Skip parent constructor to avoid dependencies
5754
*/
5855
public function __construct(
59-
$id = 0,
6056
?DataObject $urlDataObject = null
6157
) {
62-
$this->id = (int)$id;
6358
$this->urlDataObject = $urlDataObject;
6459
$this->_data = [];
6560
}
@@ -135,7 +130,7 @@ protected function getCustomAttributesCodes()
135130
*/
136131
public function getId()
137132
{
138-
return $this->id ?? null;
133+
return $this->data['id'] ?? null;
139134
}
140135

141136
/**

app/code/Magento/Checkout/Test/Unit/CustomerData/CartTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ public function testGetSectionData()
130130
$storeMock = new StoreWebsiteIdTestHelper($websiteId);
131131
$quoteMock->setFixtureStore($storeMock);
132132

133-
$productMock = new ProductTestHelper($productId);
133+
$productMock = new ProductTestHelper();
134+
$productMock->setId($productId);
134135
$quoteItemMock->setProduct($productMock);
135136

136137
$this->catalogUrlMock->expects($this->once())
@@ -206,7 +207,8 @@ public function testGetSectionDataWithCompositeProduct()
206207

207208
$quoteMock->setFixtureItems([$quoteItemMock]);
208209

209-
$productMock = new ProductTestHelper($productId);
210+
$productMock = new ProductTestHelper();
211+
$productMock->setId($productId);
210212

211213
$optionsMock = $this->createMock(Option::class);
212214
$optionsMock->expects($this->once())->method('getProduct')->willReturn($productMock);

0 commit comments

Comments
 (0)