public function testSave()
 {
     $game = new \IBL\Game();
     $game->setWeek(28);
     $game->setHomeScore(1);
     $game->setAwayScore(0);
     $game->setHomeTeamId(1);
     $game->setAwayTeamId(0);
     $this->assertNull($game->getId());
     $mapper = new \IBL\GameMapper($this->_conn);
     $mapper->save($game);
     $this->assertTrue($game->getId() !== null);
     $mapper->delete($game);
 }
 public function testSaveUpdatesDatabase()
 {
     $mapper = new \IBL\GameMapper($this->_conn);
     $game = new \IBL\Game();
     $game->setWeek(30);
     $game->setHomeTeamId(25);
     $game->setAwayTeamId(26);
     $game->setHomeScore(1);
     $game->setAwayScore(2);
     $mapper->save($game);
     $game->setAwayScore(1);
     $game->setHomeScore(2);
     $mapper->save($game);
     $game2 = $mapper->findById($game->getId());
     $this->assertEquals(2, $game2->getHomeScore());
     $mapper->delete($game);
 }