/** * @param array $languageData * @param string $inputFormat * @param string $outputFormat * @dataProvider languageCodeConversionsProvider */ public function testConversions($languageData, $inputFormat, $outputFormat) { $opts = new LanguageCodeOptions(); $converter = new Conversion(['adapter' => 'Conversio\\Adapter\\LanguageCode', 'options' => $opts]); $opts->setOutput($outputFormat); $this->assertEquals($opts->getOutput(), $outputFormat); $this->assertEquals($languageData[$opts->getOutput()], $converter->filter($languageData[$inputFormat])); }
/** * @expectedException \Conversio\Exception\InvalidArgumentException */ public function testSetNotSupportedOutputShouldThrowInvalidArgumentException() { $opts = new LanguageCodeOptions(); $opts->setOutput('giargianese'); }