예제 #1
0
 /**
  * @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]));
 }
 public function testSetAndGetOutput()
 {
     $opts = new LanguageCodeOptions();
     $this->assertInstanceOf('Conversio\\Adapter\\Options\\LanguageCodeOptions', $opts->setOutput('native'));
     $this->assertEquals('native', $opts->getOutput());
 }