Exemplo n.º 1
0
 /**
  *
  */
 public function testRatingCalculate()
 {
     $game = new Game();
     $userA = $this->container->get('core.handler.user')->getRepository()->findOneByLogin('Stas');
     $userB = $this->container->get('core.handler.user')->getRepository()->findOneByLogin('TestLogin');
     $game->setUserWhite($userA)->setUserBlack($userB)->setResultWhite(1)->setResultBlack(0)->setUserToMove($userA)->setStatus(GameStatus::END)->setRate(true);
     $this->container->get('core.handler.game')->changeGameStatus($game, GameStatus::END);
     self::assertEquals(2211, $game->getUserWhite()->getRating());
     self::assertEquals(2232, $game->getUserBlack()->getRating());
 }