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 testCreateWithCallback() { $array = ["name" => "interview 1", "questions" => [["content" => "question 1", "readingTime" => 60, "answerTime" => 60, "number" => 1]], "video" => "", "text" => "", "callback" => "http://myurl.com/done"]; $res = Interview::create($array); $this->assertEquals("Interview", get_class($res)); $this->assertTrue(isset($res->id)); $this->assertCount(1, $res->questions); $this->assertEquals("http://myurl.com/done", $res->callback); InterviewTest::$interviewId = $res->id; }