File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
Checkout/Test/Unit/CustomerData Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff 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 /**
Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments