/** * create dependent objects before running each test **/ public final function setUp() { // run the default setUp() method first parent::setUp(); // Create and insert a sport to own the test team $this->sport = new Sport(null, "sportLeague", "sportLeague2", "SportName", "SportName2"); $this->sport->insert($this->getPDO()); }
/** * create dependent objects before running each test */ public final function setUp() { //run the default setUp() method first parent::setUp(); //Generate Php 7 hash and salt // $password = "******"; $this->salt = bin2hex(openssl_random_pseudo_bytes(32)); $this->hash = hash_pbkdf2("sha512", $password, $this->salt, 262144, 128); }
/** * create dependent objects before running each test **/ public final function setUp() { // run the default setUp() method first parent::setUp(); // Create and insert a sport to own the test team $this->sport = new Sport(null, "sportLeagues", "sportLeagues2", "SportNames", "SportNames2"); $this->sport->insert($this->getPDO()); // create and insert a Profile to own the test Team $this->team = new Team(null, $this->sport->getSportId(), $this->VALID_TEAMAPIID, "TeamCities2", "TeamName"); $this->team->insert($this->getPDO()); $this->team2 = new Team(null, $this->sport->getSportId(), $this->VALID_TEAMAPIID2, "TeamCity2", "TeamName2"); $this->team2->insert($this->getPDO()); }
/** * create dependent objects before running each test */ public final function setUp() { //run the default setUp() method first parent::setUp(); // create and insert a Team to own the test $this->sport = new Sport(null, "sportLeague", "sportTeam"); $this->sport->insert($this->getPDO()); $this->team = new Team(null, $this->sport->getSportId(), $this->VALID_TEAMAPIID, $this->VALID_TEAMCITY, $this->VALID_TEAMNAME); $this->team->insert($this->getPDO()); // create and insert a Team t own the test $this->team2 = new Team(null, $this->sport->getSportId(), $this->VALID_TEAMAPIID2, $this->VALID_TEAMCITY, $this->VALID_TEAMNAME2); $this->team2->insert($this->getPDO()); // calculate the date (same as unit test) $this->VALID_GAMETIME = \DateTime::createFromFormat("Y-m-d H:i:s", "2015-03-23 15:23:04"); $this->VALID_GAMETIME2 = \DateTime::createFromFormat("Y-m-d H:i:s", "2015-03-23 15:23:04"); }
/** * Create dependent objects before running each test */ public final function setUp() { //run the default setUp() method first parent::setUp(); //create and insert a Sport to own the test playerStatistic $this->sport = new Sport(null, "sportTeam", "sportLeague"); $this->sport->insert($this->getPDO()); //create and insert a Game to own the test playerStatistic $this->game = new Game(null, "gameFirstTeamId", "GameSecondTeamId", "GameTime"); $this->game->insert($this->getPDO()); //create and insert a Player to own the test playerStatistic $this->player = new Player(null, "playerName", "playerTeamId", "playerApiId"); $this->player->insert($this->getPDO()); //create and insert a Statistic to own the test playerStatistic $this->statistic = new Statistic(null, "statisticName"); $this->statistic->insert($this->getPDO()); }
/** * Create dependent objects before running each test **/ public final function setUp() { //run the default setup() method first parent::setUp(); $this->sport = new Sport(null, "sportLeague", "sportName"); $this->sport->insert($this->getPDO()); $this->team = new Team(null, $this->sport->getSportId(), $this->VALID_TEAMAPIID, $this->VALID_TEAMCITY, $this->VALID_TEAMNAME); $this->team->insert($this->getPDO()); $this->player = new Player(null, $this->VALID_PLAYERAPIID, $this->team->getTeamId(), $this->sport->getSportId(), "PlayerName"); $this->player->insert($this->getPDO()); $password = "******"; $this->salt = bin2hex(openssl_random_pseudo_bytes(32)); $this->hash = hash_pbkdf2("sha512", $password, $this->salt, 262144, 128); $this->profile = new Profile(null, "Ronald McDonald", "*****@*****.**", $this->hash, $this->salt); $this->profile->insert($this->getPDO()); // $this->VALID_TEAM = new Team(null, $this->VALID_SPORT->getSportId(), 1, "Albuquerque", "Lobos"); // $this->VALID_TEAM->insert($this->getPDO()); // $this->VALID_PLAYER = new Player(null, $this->VALID_PLAYERAPIID, $this->VALID_TEAMID, $this->VALID_PLAYERSPORTID,"Mike"); // $this->VALID_PLAYER->insert($this->getPDO()); //Generate Hash and Salt }
/** * Create dependent objects before running each test */ public final function setUp() { //run the default setUp() method first parent::setUp(); //create and insert a Sport to own the test TeamStatistic $this->sport = new Sport(null, "sportName", "sportLeague"); $this->sport->insert($this->getPDO()); //create and insert a team to own the test TeamStatistic $this->team = new Team(null, $this->sport->getSportId(), $this->VALID_TEAMAPIID, "TeamCity", "TeamName"); $this->team->insert($this->getPDO()); $this->team2 = new Team(null, $this->sport->getSportId(), $this->VALID_TEAMAPIID2, "TeamCity2", "TeamName2"); $this->team2->insert($this->getPDO()); //create and insert a Game to own the test playerStatistic $this->game = new Game(null, $this->team->getTeamId(), $this->team2->getTeamId(), "2015-03-23 15:23:04"); $this->game->insert($this->getPDO()); // calculate the date (same as unit test) $this->VALID_GAMETIME = \DateTime::createFromFormat("Y-m-d H:i:s", "2015-03-23 15:23:04"); $this->VALID_GAMETIME2 = \DateTime::createFromFormat("Y-m-d H:i:s", "2015-03-23 16:23:04"); //create and insert a Statistic to own the test playerStatistic $this->statistic = new Statistic(null, "statisticName"); $this->statistic->insert($this->getPDO()); }