Skip to content

Commit d4eecdb

Browse files
Revert "AC-15182: PHPUnit 12 Upgrade | Remove unused Helper Files"
This reverts commit 5723c0b.
1 parent 5732515 commit d4eecdb

File tree

5 files changed

+563
-0
lines changed

5 files changed

+563
-0
lines changed
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
<?php
2+
/**
3+
* Copyright 2025 Adobe
4+
* All Rights Reserved.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Quote\Test\Unit\Helper;
9+
10+
use Magento\Quote\Api\Data\CartExtensionInterface;
11+
12+
/**
13+
* Test helper that implements CartExtensionInterface
14+
*
15+
* Provides stub implementations for all extension attribute methods
16+
*/
17+
class CartExtensionTestHelper implements CartExtensionInterface
18+
{
19+
/**
20+
* @var \Magento\NegotiableQuote\Api\Data\NegotiableQuoteInterface|null
21+
*/
22+
private $negotiableQuote;
23+
24+
/**
25+
* @var mixed
26+
*/
27+
private $couponCodes;
28+
29+
/**
30+
* @var array
31+
*/
32+
private $shippingAssignments = [];
33+
34+
/**
35+
* @var int|null
36+
*/
37+
private $companyId;
38+
39+
/**
40+
* @var mixed
41+
*/
42+
private $quoteTestAttribute;
43+
44+
/**
45+
* Constructor
46+
*
47+
* @param mixed $negotiableQuote
48+
*/
49+
public function __construct($negotiableQuote = null)
50+
{
51+
$this->negotiableQuote = $negotiableQuote;
52+
}
53+
54+
/**
55+
* Get negotiable quote
56+
*
57+
* @return \Magento\NegotiableQuote\Api\Data\NegotiableQuoteInterface|null
58+
*/
59+
public function getNegotiableQuote()
60+
{
61+
return $this->negotiableQuote;
62+
}
63+
64+
/**
65+
* Set negotiable quote
66+
*
67+
* @param \Magento\NegotiableQuote\Api\Data\NegotiableQuoteInterface|null $negotiableQuote
68+
* @return $this
69+
*/
70+
public function setNegotiableQuote($negotiableQuote)
71+
{
72+
$this->negotiableQuote = $negotiableQuote;
73+
return $this;
74+
}
75+
76+
/**
77+
* Get shipping assignments
78+
*
79+
* @return \Magento\Quote\Api\Data\ShippingAssignmentInterface[]|null
80+
*/
81+
public function getShippingAssignments()
82+
{
83+
return $this->shippingAssignments;
84+
}
85+
86+
/**
87+
* Set shipping assignments
88+
*
89+
* @param \Magento\Quote\Api\Data\ShippingAssignmentInterface[] $shippingAssignments
90+
* @return $this
91+
*/
92+
public function setShippingAssignments($shippingAssignments)
93+
{
94+
$this->shippingAssignments = $shippingAssignments;
95+
return $this;
96+
}
97+
98+
/**
99+
* Get coupon codes
100+
*
101+
* @return mixed
102+
*/
103+
public function getCouponCodes()
104+
{
105+
return $this->couponCodes;
106+
}
107+
108+
/**
109+
* Set coupon codes
110+
*
111+
* @param mixed $couponCodes
112+
* @return $this
113+
*/
114+
public function setCouponCodes($couponCodes)
115+
{
116+
$this->couponCodes = $couponCodes;
117+
return $this;
118+
}
119+
120+
/**
121+
* Get company ID
122+
*
123+
* @return int|null
124+
*/
125+
public function getCompanyId()
126+
{
127+
return $this->companyId;
128+
}
129+
130+
/**
131+
* Set company ID
132+
*
133+
* @param int|null $companyId
134+
* @return $this
135+
*/
136+
public function setCompanyId($companyId)
137+
{
138+
$this->companyId = $companyId;
139+
return $this;
140+
}
141+
142+
/**
143+
* Get quote test attribute
144+
*
145+
* @return mixed
146+
*/
147+
public function getQuoteTestAttribute()
148+
{
149+
return $this->quoteTestAttribute;
150+
}
151+
152+
/**
153+
* Set quote test attribute
154+
*
155+
* @param mixed $quoteTestAttribute
156+
* @return $this
157+
*/
158+
public function setQuoteTestAttribute($quoteTestAttribute)
159+
{
160+
$this->quoteTestAttribute = $quoteTestAttribute;
161+
return $this;
162+
}
163+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?php
2+
/**
3+
* Copyright 2025 Adobe
4+
* All Rights Reserved.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Quote\Test\Unit\Helper;
9+
10+
use Magento\Quote\Api\Data\CartItemExtensionInterface;
11+
12+
/**
13+
* Test helper for CartItemExtension to support dynamic getNegotiableQuoteItem/setNegotiableQuoteItem methods
14+
*/
15+
class CartItemExtensionTestHelper implements CartItemExtensionInterface
16+
{
17+
/**
18+
* @var \Magento\NegotiableQuote\Api\Data\NegotiableQuoteItemInterface|null
19+
*/
20+
private $negotiableQuoteItem;
21+
22+
/**
23+
* @var \Magento\SalesRule\Api\Data\RuleDiscountInterface[]|null
24+
*/
25+
private $discounts;
26+
27+
/**
28+
* @var \Magento\User\Api\Data\UserInterface|null
29+
*/
30+
private $quoteItemTestAttribute;
31+
32+
/**
33+
* Get negotiable quote item
34+
*
35+
* @return \Magento\NegotiableQuote\Api\Data\NegotiableQuoteItemInterface|null
36+
*/
37+
public function getNegotiableQuoteItem()
38+
{
39+
return $this->negotiableQuoteItem;
40+
}
41+
42+
/**
43+
* Set negotiable quote item
44+
*
45+
* @param \Magento\NegotiableQuote\Api\Data\NegotiableQuoteItemInterface|null $negotiableQuoteItem
46+
* @return $this
47+
*/
48+
public function setNegotiableQuoteItem($negotiableQuoteItem)
49+
{
50+
$this->negotiableQuoteItem = $negotiableQuoteItem;
51+
return $this;
52+
}
53+
54+
/**
55+
* Get discounts
56+
*
57+
* @return \Magento\SalesRule\Api\Data\RuleDiscountInterface[]|null
58+
*/
59+
public function getDiscounts()
60+
{
61+
return $this->discounts;
62+
}
63+
64+
/**
65+
* Set discounts
66+
*
67+
* @param \Magento\SalesRule\Api\Data\RuleDiscountInterface[]|null $discounts
68+
* @return $this
69+
*/
70+
public function setDiscounts($discounts)
71+
{
72+
$this->discounts = $discounts;
73+
return $this;
74+
}
75+
76+
/**
77+
* Get quote item test attribute
78+
*
79+
* @return \Magento\User\Api\Data\UserInterface|null
80+
*/
81+
public function getQuoteItemTestAttribute()
82+
{
83+
return $this->quoteItemTestAttribute;
84+
}
85+
86+
/**
87+
* Set quote item test attribute
88+
*
89+
* @param \Magento\User\Api\Data\UserInterface|null $quoteItemTestAttribute
90+
* @return $this
91+
*/
92+
public function setQuoteItemTestAttribute($quoteItemTestAttribute)
93+
{
94+
$this->quoteItemTestAttribute = $quoteItemTestAttribute;
95+
return $this;
96+
}
97+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/**
3+
* Copyright 2025 Adobe
4+
* All Rights Reserved.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Quote\Test\Unit\Helper;
9+
10+
use Magento\Quote\Api\Data\PaymentExtensionInterface;
11+
12+
/**
13+
* Test helper that implements PaymentExtensionInterface
14+
*
15+
* Provides stub implementations for all extension attribute methods
16+
*/
17+
class PaymentExtensionTestHelper implements PaymentExtensionInterface
18+
{
19+
/**
20+
* @var array
21+
*/
22+
private $agreementIds = [];
23+
24+
/**
25+
* Constructor
26+
*
27+
* @param array $agreementIds
28+
*/
29+
public function __construct(array $agreementIds = [])
30+
{
31+
$this->agreementIds = $agreementIds;
32+
}
33+
34+
/**
35+
* Get agreement IDs
36+
*
37+
* @return array
38+
*/
39+
public function getAgreementIds(): array
40+
{
41+
return $this->agreementIds;
42+
}
43+
44+
/**
45+
* Set agreement IDs
46+
*
47+
* @param array $agreementIds
48+
* @return $this
49+
*/
50+
public function setAgreementIds($agreementIds)
51+
{
52+
$this->agreementIds = $agreementIds;
53+
return $this;
54+
}
55+
}

0 commit comments

Comments
 (0)