20 $productSku =
'bundle-product';
25 'title' =>
'Bundle Product Items',
32 'can_change_quantity' => 1,
33 'is_default' =>
false,
42 $this->assertArrayHasKey(
'option_id',
$result);
43 $expected[
'product_links'][0][
'option_id'] =
$result[
'option_id'];
45 $this->assertNotNull(
$result[
'product_links'][0][
'id']);
46 unset(
$result[
'product_links'][0][
'id']);
50 ksort($expected[
'product_links'][0]);
51 ksort(
$result[
'product_links'][0]);
52 $this->assertEquals($expected,
$result);
60 $productSku =
'bundle-product';
66 'title' =>
'Bundle Product Items',
73 'can_change_quantity' => 1,
74 'is_default' =>
false,
83 $this->assertArrayHasKey(0,
$result);
84 $this->assertArrayHasKey(
'option_id',
$result[0]);
85 $expected[0][
'product_links'][0][
'option_id'] =
$result[0][
'option_id'];
87 $this->assertNotNull(
$result[0][
'product_links'][0][
'id']);
88 unset(
$result[0][
'product_links'][0][
'id']);
92 ksort($expected[0][
'product_links'][0]);
93 ksort(
$result[0][
'product_links'][0]);
94 $this->assertEquals($expected,
$result);
103 $productSku =
'bundle-product';
112 }
catch (\Exception $e) {
113 throw new \Magento\Framework\Exception\NoSuchEntityException();
122 $productSku =
'bundle-product';
127 'title' =>
'test product',
128 'product_links' => [],
129 'sku' => $productSku,
136 $this->assertArrayHasKey(
'option_id',
$result);
137 $this->assertArrayHasKey(
'sku',
$result);
150 $productSku =
'bundle-product';
152 'title' =>
'someTitle',
155 'sku' => $productSku,
160 $this->assertGreaterThan(0, count(
$options));
161 $this->assertArrayHasKey(
'option_id',
$options[0]);
168 $this->assertCount(7,
$result);
169 $this->assertArrayHasKey(
'title',
$result);
182 'resourcePath' =>
'/V1/bundle-products/options/' .
$optionId,
186 'service' =>
'bundleProductOptionManagementV1',
188 'operation' =>
'bundleProductOptionManagementV1Save',
192 if (TESTS_WEB_API_ADAPTER == self::ADAPTER_SOAP) {
206 'resourcePath' =>
'/V1/bundle-products/options/add',
210 'service' =>
'bundleProductOptionManagementV1',
212 'operation' =>
'bundleProductOptionManagementV1Save',
227 'resourcePath' => str_replace(
':sku', $productSku, self::RESOURCE_PATH) .
'/' .
$optionId,
233 'operation' => self::SERVICE_NAME .
'DeleteById',
247 'resourcePath' => str_replace(
':sku', $productSku, self::RESOURCE_PATH) .
'/all',
253 'operation' => self::SERVICE_NAME .
'GetList',
256 return $this->
_webApiCall($serviceInfo, [
'sku' => $productSku]);
268 'resourcePath' => str_replace(
':sku', $productSku, self::RESOURCE_PATH) .
'/' .
$optionId,
274 'operation' => self::SERVICE_NAME .
'Get',
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)
update($optionId, $option)