/** * Test decodeFile function properly decodes file data * with YAML format. */ public function testDecodeFile() { $dataFilePath = self::$dataFileFixturesHelper->buildEncodedFilePath('data.yaml'); $expectedResult = self::$dataFileFixturesHelper->loadDecodedData(); $actualResult = $this->yamlDatafileDecoder->decodeFile($dataFilePath); $this->assertEquals($expectedResult, $actualResult); }
/** * Test decodeFile function returns proper result * when data format hasn't been set * and decoder must recognize format by file extension. */ public function testDecodeFileWhenDataFormatIsNotSet() { $expectedResult = array("<FORMAT DECODED DATA>Dummy data</FORMAT DECODED DATA>"); $dataFilePath = self::$dataFileFixturesHelper->buildEncodedFilePath('data.format'); $actualResult = $this->datafileDecoder->decodeFile($dataFilePath); $this->assertEquals($expectedResult, $actualResult); }