コード例 #1
0
ファイル: LexerTest.php プロジェクト: Exquance/csv
 public function test_shift_jis_CSV()
 {
     $shiftJisCsv = CSVFiles::getShiftJisCsv();
     $lines = array(array('あ', 'い', 'う', 'え', 'お'), array('日本語', '日本語', '日本語', '日本語', '日本語'), array('ぱ', 'ぴ', 'ぷ', 'ぺ', 'ぽ'), array('"quoted"', "a'quote'", 'a, b and c', '', ''));
     $interpreter = $this->getMock('Goodby\\CSV\\Import\\Standard\\Interpreter', array('interpret'));
     $interpreter->expects($this->at(0))->method('interpret')->with($lines[0]);
     $interpreter->expects($this->at(1))->method('interpret')->with($lines[1]);
     $interpreter->expects($this->at(2))->method('interpret')->with($lines[2]);
     $interpreter->expects($this->at(3))->method('interpret')->with($lines[3]);
     $config = new LexerConfig();
     $config->setToCharset('UTF-8')->setFromCharset('SJIS-win');
     $lexer = new Lexer($config);
     $lexer->parse($shiftJisCsv, $interpreter);
 }