34 $this->
_markTestAsRestOnly(
"JSON generation tests are intended to be executed for REST adapter only.");
37 ->getStore()->getCode();
46 $this->isSingleService =
false;
48 $resourcePath =
'/schema?services=testModule5AllSoapAndRestV1,testModule5AllSoapAndRestV2';
52 'resourcePath' => $resourcePath,
63 $this->isSingleService =
false;
65 $resourcePath =
'/schema?services=testModule5AllSoapAndRestV2';
69 'resourcePath' => $resourcePath,
89 'resourcePath' => $resourcePath,
103 $this->isSingleService =
false;
105 $resourcePath =
'/schema?services=invalidServiceName';
109 'resourcePath' => $resourcePath,
117 private function assertRecursiveArray($expected, $actual, $checkVal)
121 foreach ($expected as $expKey => $expVal) {
122 $this->assertArrayHasKey($expKey, $actual,
'Schema does not contain \'' . $expKey .
'\' section.
'); 123 if (is_array($expVal)) { 124 $this->assertTrue(is_array($actual[$expKey])); 125 $this->assertRecursiveArray($expVal, $actual[$expKey], $checkVal); 126 } elseif ($checkVal) { 127 $this->assertEquals($expVal, $actual[$expKey], '\
'' . $expKey .
'\' section content is invalid.
'); 132 public function checkActualData($expected, $actual) 134 $this->assertRecursiveArray($expected, $actual, true); 137 public function getExpectedCommonData() 139 $versionParts = explode('.
', $this->productMetadata->getVersion()); 140 if (!isset($versionParts[0]) || !isset($versionParts[1])) { 141 return []; // Major and minor version are not set - return empty response 143 $majorMinorVersion = $versionParts[0] . '.
' . $versionParts[1]; 144 $url = str_replace(':
145 $host = strpos(
$url,
'/') ? strstr(
$url,
'/',
true) :
$url;
146 $basePath = strstr(rtrim(
$url,
'/'),
'/');
147 $basePath = $basePath ? trim($basePath,
'/') .
'/' :
'';
152 'version' => $majorMinorVersion,
153 'title' => $this->productMetadata->getName() .
' ' .$this->productMetadata->getEdition(),
156 'basePath' => $basePath,
169 'name' =>
'testModule5AllSoapAndRestV1',
170 'description' =>
'Both SOAP and REST Version ONE',
173 'name' =>
'testModule5AllSoapAndRestV2',
174 'description' =>
'Both SOAP and REST Version TWO',
178 '/V1/TestModule5/{parentId}/nestedResource/{entityId}' => [
181 'testModule5AllSoapAndRestV1',
183 'description' =>
'Update existing item.',
184 'operationId' =>
'testModule5AllSoapAndRestV1NestedUpdatePut',
187 'name' =>
'parentId',
193 'name' =>
'entityId',
199 'name' =>
'testModule5AllSoapAndRestV1NestedUpdatePutBody',
207 '$ref' =>
'#/definitions/test-module5-v1-entity-all-soap-and-rest',
216 'description' =>
'200 Success.',
218 '$ref' =>
'#/definitions/test-module5-v1-entity-all-soap-and-rest',
222 'description' =>
'401 Unauthorized',
224 '$ref' =>
'#/definitions/error-response',
228 'description' =>
'Unexpected error',
230 '$ref' =>
'#/definitions/error-response',
238 'framework-attribute-interface' => [
240 'description' =>
'Interface for custom attribute value.',
242 'attribute_code' => [
244 'description' =>
'Attribute code',
248 'description' =>
'Attribute value',
256 'test-module5-v1-entity-all-soap-and-rest' => [
258 'description' =>
'Some Data Object short description. Data Object long multi line description.',
262 'description' =>
'Item ID',
266 'description' =>
'Item name',
270 'description' =>
'If entity is enabled',
274 'description' =>
'If current entity has a property defined',
276 'custom_attributes' => [
278 'description' =>
'Custom attributes values.',
280 '$ref' =>
'#/definitions/framework-attribute-interface',
304 'name' =>
'testModule5AllSoapAndRestV2',
305 'description' =>
'Both SOAP and REST Version TWO',
309 '/V2/TestModule5/{id}' => [
312 'testModule5AllSoapAndRestV2',
314 'description' =>
'Delete existing item.',
315 'operationId' =>
'testModule5AllSoapAndRestV2DeleteDelete',
326 'description' =>
'200 Success.',
328 '$ref' =>
'#/definitions/test-module5-v2-entity-all-soap-and-rest',
332 'description' =>
'401 Unauthorized',
334 '$ref' =>
'#/definitions/error-response',
338 'description' =>
'Unexpected error',
340 '$ref' =>
'#/definitions/error-response',
348 'test-module5-v2-entity-all-soap-and-rest' => [
350 'description' =>
'Some Data Object short description. Data Object long multi line description.',
_markTestAsRestOnly($message=null)
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)
checkActualData($expected, $actual)
testMultiServiceRetrieval()
testInvalidRestUrlInvalidServiceName()
getExpectedSingleServiceData()
testSingleServiceRetrieval()
getExpectedMultiServiceData()
testInvalidRestUrlNoServices()
static getObjectManager()