@@ -40,13 +40,13 @@ protected function setUp(): void
40
40
}
41
41
42
42
/**
43
- * Test the complete workflow from Steps 1-16
43
+ * Test the complete workflow
44
44
* Verify that REST-API updating product stock_item does not delete downloadable_product_links
45
45
*
46
46
* @return void
47
47
*/
48
- #[DataFixture(DownloadableProduct::class, [
49
- ' sku ' => ' downloadable-product ' ,
48
+ #[
49
+ DataFixture(DownloadableProduct::class, [
50
50
'name ' => 'Downloadable Product Test ' ,
51
51
'price ' => 50.00 ,
52
52
'type_id ' => 'downloadable ' ,
@@ -81,27 +81,26 @@ protected function setUp(): void
81
81
]
82
82
]
83
83
], 'downloadable_product ' )]
84
- public function testStockItemUpdatePreservesDownloadableLinks ()
84
+ public function testStockItemUpdatePreservesDownloadableLinks (): void
85
85
{
86
86
// Get the product SKU from the fixture
87
- $ product = $ this ->fixtures ->get ('downloadable_product ' );
88
- $ productSku = $ product ->getSku ();
87
+ $ productSku = $ this ->fixtures ->get ('downloadable_product ' )->getSku ();
89
88
90
89
// Get original product and verify it has downloadable links
91
90
$ originalProduct = $ this ->getProductBySku ($ productSku );
92
91
$ this ->verifyProductHasDownloadableLinks ($ originalProduct , 'Original product should have downloadable links ' );
93
92
$ originalLinks = $ originalProduct ['extension_attributes ' ]['downloadable_product_links ' ];
94
93
95
- // Steps 8-14: Update product stock_item via catalogProductRepositoryV1 PUT endpoint
94
+ // Update product stock_item via catalogProductRepositoryV1 PUT endpoint
96
95
$ updatedProduct = $ this ->updateProductStockItem ($ productSku );
97
96
98
- // Verify the API call was successful (Step 14: Server response Code=200)
97
+ // Verify the API call was successful
99
98
$ this ->assertNotEmpty ($ updatedProduct , 'API response should not be empty ' );
100
99
$ this ->assertEquals ($ productSku , $ updatedProduct ['sku ' ]);
101
100
$ this ->assertEquals ('99.99 ' , $ updatedProduct ['price ' ]);
102
101
$ this ->assertEquals ('1 ' , $ updatedProduct ['status ' ]);
103
102
104
- // Steps 15-16: Verify downloadable product links are preserved
103
+ // Verify downloadable product links are preserved
105
104
$ this ->verifyDownloadableLinksPreserved ($ originalLinks , $ productSku );
106
105
}
107
106
0 commit comments