public function testFindOne() { $this->assertNotNull(InterviewTest::$interviewId); $res = Interview::findOne(InterviewTest::$interviewId); $this->assertEquals("interview 1", $res->name); $this->assertEquals("", $res->video); $this->assertEquals("", $res->text); $this->assertEquals(1, count($res->questions)); $this->assertEquals("question 1", $res->questions[0]->content); }
/** * @depends testCreateWithQuestion */ public function testCreateWithQuestionAndInterviewName() { $param = ["mail" => "*****@*****.**", "alert" => false, "questions" => [["content" => "question 1", "readingTime" => 60, "answerTime" => 60, "number" => 1]], "lang" => "en", "deadline" => intval((microtime(true) + ApplicantTest::$oneMonth) * 1000), "interviewName" => "My Super Interview"]; $res = Applicant::create($param); $this->assertEquals("*****@*****.**", $res->mail); $this->assertFalse($res->deleted); $this->assertCount(1, $res->questions); $this->assertEquals("http://itwapp.io", $res->callback); $interview = Interview::findOne($res->interview); $this->assertEquals('My Super Interview', $interview->name); Interview::delete($res->interview, array("withApplicant" => true)); $app = Applicant::findOne($res->id); $this->assertTrue($app->deleted); }