Example #1
0
 public function testLshapedEdge()
 {
     $this->boardWalker = $this->createBoardWalker([SquareInterface::POSITION_B1 => PieceInterface::TYPE_KNIGHT]);
     $this->boardWalker->start(SquareInterface::POSITION_B1)->lshaped();
     $this->assertEquals(SquareInterface::POSITION_B1, $this->boardWalker->getPosition(), 'Position should stay the same after calling lshaped()');
     $expected = [[SquareInterface::POSITION_B1 => SquareInterface::POSITION_A3], [SquareInterface::POSITION_B1 => SquareInterface::POSITION_C3], [SquareInterface::POSITION_B1 => SquareInterface::POSITION_D2]];
     $actual = $this->simplifyMoves($this->boardWalker->flush());
     $this->assertEqualMoves($expected, $actual);
 }