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; }
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); } }
/** * Sets the API secret key to be used for requests. * * @param string $secretKey */ public static function setApiSecretKey($secretKey) { self::$secretKey = $secretKey; }
static function setUpBeforeClass() { Itwapp::setApiKey(getenv("itwappApiKey")); Itwapp::setApiSecretKey(getenv("itwappApiSecret")); }