/** * @covers Box\TestScribe\Utils\ValueTransformer */ public function test_object_with_JsonSerializable_support() { // Execute the method under test. $inputHistoryData = new InputHistoryData(); $inputHistoryData->setData(['key' => 'value']); $objectUnderTest = new \Box\TestScribe\Utils\ValueTransformer(); $executionResult = $objectUnderTest->translateObjectsAndResourceToString($inputHistoryData); // Validate the execution result. $expected = '( Box\\TestScribe\\InputHistory\\InputHistoryData ) object value ( {"key":"value"} )'; $this->assertSame($expected, $executionResult, 'Variable ( executionResult ) doesn\'t have the expected value.'); }
/** * @return \Box\TestScribe\InputHistory\InputHistoryData */ public function loadHistory() { $data = new InputHistoryData(); $historyFilePath = $this->globalComputedConfig->getHistoryFile(); if ($this->globalFunction->file_exists($historyFilePath)) { $yamlString = $this->globalFunction->file_get_contents($historyFilePath); $parser = new Parser(); $dataArray = $parser->parse($yamlString); $data->setData($dataArray); } return $data; }