Exemple #1
0
 public function testGetGame()
 {
     $file = 'test/data/2010 World Championship.pgn';
     $parser = new PgnParser($file);
     $game = $parser->getGame(1);
     $this->assertInstanceOf('\\AmyBoyd\\PgnParser\\Game', $game);
 }
Exemple #2
0
 public function testToJSON()
 {
     $file = 'test/data/2010 World Championship.pgn';
     $parser = new PgnParser($file);
     $game = $parser->getGame(5);
     $json = $game->toJSON();
     $this->assertInternalType('string', $json);
     $this->assertInternalType('array', json_decode($json, true));
     $this->assertJsonStringEqualsJsonFile(__DIR__ . '/expected-toJSON-1.json', $json);
 }