/** * @test */ public function shouldNotAutoCreateFenWhenExists() { // given $fen = new Fen("rnbqkbnr\\/pppppppp\\/8\\/8\\/8\\/8\\/PPPPPPPP\\/RNBQKBNR w KQkq - 0 1"); $fen2 = new Fen("rnbqkbnr\\/pppppppp\\/8\\/8\\/8\\/8\\/PPPPPPPP\\/RNBQKBNR w KQkq - 0 1"); // then $this->assertEquals($fen->getId(), $fen2->getId()); }
public static function getIdByFen($fen) { $fen = new Fen($fen); return $fen->getId(); }
public function setFen($fen) { $fen = new Fen($fen); $this->setValue('fen_id', $fen->getId()); }