Fixed problem with invalid castle moves
This commit is contained in:
@@ -105,6 +105,24 @@ class ParserTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($parser->isOnSameFile($this->getNumericSquare('a1'), $this->getNumericSquare('a2')));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldNotBeAbleToCastleInInvalidPositions(){
|
||||
// given
|
||||
$fen = 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1';
|
||||
|
||||
// when
|
||||
$parser = $this->getParser($fen);
|
||||
$legalMoves = $parser->getValidMovesAndResult("white");
|
||||
$moves = $legalMoves['moves'];
|
||||
|
||||
// then
|
||||
$this->assertEquals(array(), $moves[4]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
Reference in New Issue
Block a user