Esempio n. 1
0
 public function setUp()
 {
     parent::setUp();
     $td = TestData::getData('userTestData');
     //creating sample contest
     $cd = TestData::genContestDecription();
     $this->contestID = $this->apiCreateContest(array('contest' => $cd))->createdContestID;
     //store columns info
     $this->userDataColumns = unserialize(serialize($cd->data));
     //creating sample contest admin
     $this->apiRegisterUser(array('user' => createUser($td['ContestAdmin'][0], $td['ContestAdmin'][1], 'ContestAdmin', TestData::genStrArray(sizeof($this->userDataColumns), TestData::MAX_DATA_LENGTH))));
     //create sample user with type Participant
     $this->apiRegisterUser(array('user' => createUser($td['Participant'][0], $td['Participant'][1], 'Participant', TestData::genStrArray(sizeof($this->userDataColumns), TestData::MAX_DATA_LENGTH))));
     //create contest admin connect
     $ca_req = new ConnectToContestRequest();
     $ca_req->login = $td['ContestAdmin'][0];
     $ca_req->password = $td['ContestAdmin'][1];
     $ca_req->contestID = $this->contestID;
     $this->caConnect = RequestSender::send($ca_req);
     //create participant connect
     $p_req = new ConnectToContestRequest();
     $p_req->login = $td['Participant'][0];
     $p_req->password = $td['Participant'][1];
     $p_req->contestID = $this->contestID;
     $this->pConnect = RequestSender::send($p_req);
 }