Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CategoryAttributeOptionManagementInterfaceTest.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Catalog\Api;
7 
9 
11 {
12  const SERVICE_NAME = 'catalogCategoryAttributeOptionManagementV1';
13  const SERVICE_VERSION = 'V1';
14  const RESOURCE_PATH = '/V1/categories/attributes';
15 
16  public function testGetItems()
17  {
18  $this->_markTestAsRestOnly('Fix inconsistencies in WSDL and Data interfaces');
19  $testAttributeCode = 'include_in_menu';
20  $expectedOptions = [
21  [
22  'label' => 'Yes',
23  'value' => '1',
24  ],
25  [
26  'label' => 'No',
27  'value' => '0',
28  ],
29  ];
30 
31  $serviceInfo = [
32  'rest' => [
33  'resourcePath' => self::RESOURCE_PATH . '/' . $testAttributeCode . '/options',
35  ],
36  'soap' => [
37  'service' => self::SERVICE_NAME,
38  'serviceVersion' => self::SERVICE_VERSION,
39  'operation' => self::SERVICE_NAME . 'getItems',
40  ],
41  ];
42 
43  $response = $this->_webApiCall($serviceInfo, ['attributeCode' => $testAttributeCode]);
44 
45  $this->assertTrue(is_array($response));
46  $this->assertEquals($expectedOptions, $response);
47  }
48 }
$response
Definition: 404.php:11
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)