示例#1
0
 static function setUpBeforeClass()
 {
     Itwapp::setApiKey(getenv("itwappApiKey"));
     Itwapp::setApiSecretKey(getenv("itwappApiSecret"));
     //Create an interview
     $array = ["name" => "interview 1", "questions" => [["content" => "question 1", "readingTime" => 60, "answerTime" => 60, "number" => 1]], "video" => "", "text" => ""];
     $res = Interview::create($array);
     ApplicantTest::$interviewId = $res->id;
 }
示例#2
0
 public function testAuth()
 {
     $this->assertNotNull(ItwappTest::$mail);
     $this->assertNotNull(ItwappTest::$password);
     try {
         $accessToken = Itwapp::Authenticate(ItwappTest::$mail, ItwappTest::$password);
         $object = $this->findAccessTokenInArrayWithCompanyId($accessToken, ItwappTest::$companyId);
         $this->assertNotNull($object);
         $this->assertEquals(ItwappTest::$itwappApiKey, $object->getApiKey());
         $this->assertEquals(ItwappTest::$itwappApiSecret, $object->getSecretKey());
     } catch (UnauthorizedException $e) {
         $this->fail($e);
     } catch (Exception $e) {
         $this->fail($e);
     }
 }
示例#3
0
 /**
  * Sets the API secret key to be used for requests.
  *
  * @param string $secretKey
  */
 public static function setApiSecretKey($secretKey)
 {
     self::$secretKey = $secretKey;
 }
示例#4
0
 static function setUpBeforeClass()
 {
     Itwapp::setApiKey(getenv("itwappApiKey"));
     Itwapp::setApiSecretKey(getenv("itwappApiSecret"));
 }