Example #1
0
 public function test_ignore_header()
 {
     $csvFilename = CSVFiles::getIssue5CSV();
     $config = new LexerConfig();
     $config->setIgnoreHeaderLine(true)->setToCharset('UTF-8')->setFromCharset('UTF-8');
     $lexer = new Lexer($config);
     $interpreter = new Interpreter();
     $interpreter->addObserver(function (array $columns) use(&$csvContents) {
         $csvContents[] = $columns;
     });
     $lexer->parse($csvFilename, $interpreter);
     $this->assertSame(array(array("1", "スティック型クリーナ", "*****@*****.**"), array("2", "bob", "*****@*****.**"), array("14", "スティック型クリーナ", "*****@*****.**"), array("16", "スティック型", "*****@*****.**")), $csvContents);
 }