/** *create dependent objects before running each test **/ public final function setUp() { //run the default setUp() method first parent::setUp(); //create and insert a Company to own the test Crew $this->company = new Company(null, "Kitty Scratchers", "1600 Pennsylvania Ave NW", "Senator's Palace", "Senator Arlo", "WA", "Felis Felix", "20500", "+12125551212", "*****@*****.**", "www.kitty.com"); $this->company->insert($this->getPDO()); //calculate the date(just use the time the unit test was setup...) //$this->VALID_CREWDATE = new \DateTime(); }
/** * create dependent objects before running each test */ public final function setUp() { // run the default setUp() method first parent::setUp(); $password = "******"; $activation = bin2hex(random_bytes(16)); $salt = bin2hex(random_bytes(32)); $hash = hash_pbkdf2("sha512", $password, $salt, 262144); // creates and inserts Company to sql for User foreign key relations $this->company = new Company(null, "Taco B.", "404 Taco St.", "suite:666", "Attention!!", "NM", "Burque", "87106", "5055551111", "*****@*****.**", "www.tocobell.com"); $this->company->insert($this->getPDO()); $_SESSION["company"] = $this->company; // creates and inserts Crew to sql for User foreign key relations $this->crew = new Crew(null, $this->company->getCompanyId(), "the moon"); $this->crew->insert($this->getPDO()); // creates and inserts Access to sql for User foreign key relations $this->access = new Access(null, "requestor or admin"); $this->access->insert($this->getPDO()); // create and insert a User to own the test Request $this->requestor = new User(null, $this->company->getCompanyId(), $this->crew->getCrewId(), $this->access->getAccessId(), "5551212", "Johnny", "Requestorman", "*****@*****.**", $activation, $hash, $salt); $this->requestor->insert($this->getPDO()); $this->admin = new User(null, $this->company->getCompanyId(), $this->crew->getCrewId(), $this->access->getAccessId(), "5552121", "Suzy", "Hughes", "*****@*****.**", $activation, $hash, $salt); $this->admin->insert($this->getPDO()); // calculate the date (just use the time the unit test was setup...) $this->VALID_REQUESTTIMESTAMP = new \DateTime(); $this->VALID_REQUESTACTIONTIMESTAMP = new \DateTime(); }