9 use AspectMock\Test as AspectMock;
26 $entityName =
"EntityOne";
27 $entityStepKey =
"StepKey";
29 $dataValue =
"testValue";
46 \"" . strtolower($dataKey) .
"\" : \"{$dataValue}\" 62 $persistedValue =
$handler->retrieveEntityField($entityStepKey, $dataKey, $scope);
63 $this->assertEquals($dataValue, $persistedValue);
69 $entityName =
"EntityOne";
70 $entityStepKey =
"StepKey";
72 $dataValue =
"testValue";
89 \"" . strtolower($dataKey) .
"\" : \"{$dataValue}\" 111 $this->addToAssertionCount(1);
117 $entityName =
"EntityOne";
118 $entityStepKey =
"StepKey";
119 $dataKey =
"testKey";
120 $dataValue =
"testValue";
125 'type' =>
'testType',
129 'value' => $dataValue
137 \"" . strtolower($dataKey) .
"\" : \"{$dataValue}\" 153 $persistedValue =
$handler->retrieveEntityField($entityStepKey, $dataKey, $scope);
154 $this->assertEquals($dataValue, $persistedValue);
159 $this->markTestSkipped(
"Potential Bug in DataPersistenceHandler class");
161 $entityName =
"EntityOne";
162 $entityStepKey =
"StepKey";
163 $dataKey =
"testKey";
164 $dataValue =
"testValue";
165 $updateName =
"EntityTwo";
166 $updateValue =
"newValue";
171 'type' =>
'testType',
175 'value' => $dataValue
180 'type' =>
'testType',
184 'value' => $updateValue
192 \"" . strtolower($dataKey) .
"\" : \"{$dataValue}\" 197 \"" . strtolower($dataKey) .
"\" : \"{$updateValue}\" 219 $persistedValue =
$handler->retrieveEntityField($entityStepKey, $dataKey, $scope);
220 $this->assertEquals($updateValue, $persistedValue);
226 $entityNameOne =
"EntityOne";
227 $entityStepKeyOne =
"StepKeyOne";
228 $dataKeyOne =
"testKeyOne";
229 $dataValueOne =
"testValueOne";
230 $entityNameTwo =
"EntityTwo";
231 $entityStepKeyTwo =
"StepKeyTwo";
232 $dataKeyTwo =
"testKeyTwo";
233 $dataValueTwo =
"testValueTwo";
234 $entityNameThree =
"EntityThree";
235 $entityStepKeyThree =
"StepKeyThree";
236 $dataKeyThree =
"testKeyThree";
237 $dataValueThree =
"testValueThree";
242 'type' =>
'testType',
245 'key' => $dataKeyOne,
246 'value' => $dataValueOne
251 'type' =>
'testType',
254 'key' => $dataKeyTwo,
255 'value' => $dataValueTwo
259 $entityNameThree => [
260 'type' =>
'testType',
263 'key' => $dataKeyThree,
264 'value' => $dataValueThree
272 \"" . strtolower($dataKeyOne) .
"\" : \"{$dataValueOne}\" 277 \"" . strtolower($dataKeyTwo) .
"\" : \"{$dataValueTwo}\" 280 $jsonReponseThree =
" 282 \"" . strtolower($dataKeyThree) .
"\" : \"{$dataValueThree}\" 312 $retrievedFromTest =
$handler->retrieveEntityField(
317 $retrievedFromHook =
$handler->retrieveEntityField(
322 $retrievedFromSuite =
$handler->retrieveEntityField(
328 $this->assertEquals($dataValueOne, $retrievedFromTest);
329 $this->assertEquals($dataValueTwo, $retrievedFromHook);
330 $this->assertEquals($dataValueThree, $retrievedFromSuite);
341 $property = new \ReflectionProperty(DataObjectHandler::class,
"INSTANCE");
342 $property->setAccessible(
true);
343 $property->setValue(
null);
345 $mockDataProfileSchemaParser = AspectMock::double(DataProfileSchemaParser::class, [
346 'readDataProfiles' => $parserOutput
349 $mockObjectManager = AspectMock::double(ObjectManager::class, [
350 'create' => $mockDataProfileSchemaParser
353 AspectMock::double(ObjectManagerFactory::class, [
354 'getObjectManager' => $mockObjectManager
360 AspectMock::double(CurlHandler::class, [
361 "__construct" =>
null,
363 "getRequestDataArray" => [],
364 "isContentTypeJson" =>
true 371 $property = new \ReflectionProperty(PersistedObjectHandler::class,
"INSTANCE");
372 $property->setAccessible(
true);
373 $property->setValue(
null);
testRetrieveEntityAcrossScopes()
mockCurlHandler($response)
mockDataHandlerWithOutput($parserOutput)
catch(\Exception $e) $handler