Skip to content

Commit d598262

Browse files
committed
#19806: Web-Api test fix.
1 parent b39550a commit d598262

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dev/tests/api-functional/testsuite/Magento/Downloadable/Api/ProductRepositoryTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,10 @@ public function testUpdateDownloadableProductSamplesWithNewFile()
472472
'title' => 'sample2_updated',
473473
'sort_order' => 2,
474474
'sample_type' => 'file',
475+
'sample_file_content' => [
476+
'name' => 'sample2.jpg',
477+
'file_data' => base64_encode(file_get_contents($this->testImagePath)),
478+
],
475479
];
476480

477481
$response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_samples"] =
@@ -606,7 +610,7 @@ protected function deleteProductBySku($productSku)
606610
protected function saveProduct($product)
607611
{
608612
if (isset($product['custom_attributes'])) {
609-
for ($i=0; $i<sizeof($product['custom_attributes']); $i++) {
613+
for ($i = 0, $iMax = count($product['custom_attributes']); $i < $iMax; $i++) {
610614
if ($product['custom_attributes'][$i]['attribute_code'] == 'category_ids'
611615
&& !is_array($product['custom_attributes'][$i]['value'])
612616
) {

0 commit comments

Comments
 (0)