コード例 #1
0
ファイル: ParserTest.php プロジェクト: renanbr/bibtex-parser
 public function testTrailingCommaMustBeAccepted()
 {
     $listener = new DummyListener();
     $parser = new Parser();
     $parser->addListener($listener);
     $parser->parseFile(__DIR__ . '/resources/trailing-comma.bib');
     $expected = [[Parser::TYPE, 'trailingComma'], [Parser::KEY, 'foo'], [Parser::RAW_VALUE, 'bar']];
     $this->assertEquals($expected, $listener->calls);
 }
コード例 #2
0
 public function testCitationKey()
 {
     $listener = new Listener();
     $parser = new Parser();
     $parser->addListener($listener);
     $parser->parseFile(__DIR__ . '/resources/citation-key.bib');
     $expected = [['type' => 'citationKey', 'citation-key' => 'Someone2016', 'foo' => 'bar']];
     $actual = $listener->export();
     $this->assertEquals($expected, $actual);
 }