예제 #1
0
 public function testDelete()
 {
     $mapperDb = new MatchMapperDb();
     $match = $mapperDb->load($this->matchId);
     $mapperDb->save($match);
     $mapperDb->delete($match->get('match_id'));
     $match = $mapperDb->load($this->matchId);
     $this->assertNull($match->get('match_id'));
 }
예제 #2
0
 public static function setUpBeforeClass()
 {
     $leaguesMapperWeb = new LeaguesMapperWeb();
     $leagues = $leaguesMapperWeb->load();
     $leaguesMapperDb = new LeaguesMapperDb();
     $leaguesMapperDb->save($leagues[600]);
     $matchMapperWeb = new MatchMapperWeb(683300315);
     $match = $matchMapperWeb->load();
     $matchMapperDb = new MatchMapperDb();
     $matchMapperDb->save($match);
 }
예제 #3
0
 public function testDelete()
 {
     $additionalMatchId = 886357301;
     $matchMapperWeb = new MatchMapperWeb($additionalMatchId);
     $match = $matchMapperWeb->load();
     $matchMapperDb = new MatchMapperDb();
     $matchMapperDb->save($match);
     $matchesMapperDb = new MatchesMapperDb();
     $matchesMapperDb->delete(array($additionalMatchId, $this->matchId));
     $db = Db::obtain();
     $this->assertEquals(0, count($db->fetchArrayPDO('SELECT * FROM matches')));
     $this->assertEquals(0, count($db->fetchArrayPDO('SELECT * FROM slots')));
     $this->assertEquals(0, count($db->fetchArrayPDO('SELECT * FROM additional_units')));
     $this->assertEquals(0, count($db->fetchArrayPDO('SELECT * FROM ability_upgrades')));
     $this->assertEquals(0, count($db->fetchArrayPDO('SELECT * FROM picks_bans')));
 }