diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddDownloadableProductWithCustomOptionsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddDownloadableProductWithCustomOptionsToCartTest.php index 60ced7f8cb2a5..8b8973ad0fd95 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddDownloadableProductWithCustomOptionsToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddDownloadableProductWithCustomOptionsToCartTest.php @@ -72,13 +72,14 @@ public function testAddDownloadableProductWithOptions() self::assertCount($qty, $response['addDownloadableProductsToCart']['cart']); $customizableOptionsOutput = $response['addDownloadableProductsToCart']['cart']['items'][0]['customizable_options']; - $assignedOptionsCount = count($customOptionsValues); - for ($counter = 0; $counter < $assignedOptionsCount; $counter++) { - $expectedValues = $this->buildExpectedValuesArray($customOptionsValues[$counter]['value_string']); + $count = 0; + foreach ($customOptionsValues as $value) { + $expectedValues = $this->buildExpectedValuesArray($value['value_string']); self::assertEquals( $expectedValues, - $customizableOptionsOutput[$counter]['values'] + $customizableOptionsOutput[$count]['values'] ); + $count++; } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php index 4a043a7315e23..561318889e325 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php @@ -72,13 +72,14 @@ public function testAddVirtualProductWithOptions() self::assertCount(1, $response['addVirtualProductsToCart']['cart']); $customizableOptionsOutput = $response['addVirtualProductsToCart']['cart']['items'][0]['customizable_options']; - $assignedOptionsCount = count($customOptionsValues); - for ($counter = 0; $counter < $assignedOptionsCount; $counter++) { - $expectedValues = $this->buildExpectedValuesArray($customOptionsValues[$counter]['value_string']); + $count = 0; + foreach ($customOptionsValues as $value) { + $expectedValues = $this->buildExpectedValuesArray($value['value_string']); self::assertEquals( $expectedValues, - $customizableOptionsOutput[$counter]['values'] + $customizableOptionsOutput[$count]['values'] ); + $count++; } }