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); }
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); }