コード例 #1
0
ファイル: InterviewTest.php プロジェクト: itwapp/itwapp-php
 public function testDeleteWithCallback()
 {
     $this->assertNotNull(InterviewTest::$interviewId);
     Interview::delete(InterviewTest::$interviewId, array());
 }
コード例 #2
0
ファイル: ajax_action.php プロジェクト: nistormihai/Newscoop
}

$f_action = Input::Get('f_action', 'string');

if (!camp_interview_permission_check($f_action)) {
    echo getGS('You do not have the right to perform this action.');
    exit;
}

switch ($f_action) {
    case 'interviews_delete':
        $f_interviews = Input::Get('f_interviews', 'array');

        foreach ($f_interviews as $interview_id) {
            $Interview = new Interview($interview_id);
            $Interview->delete();
        }
    break;

    case 'items_delete':
        $f_items = Input::Get('f_items', 'array');

        foreach ($f_items as $item_id) {
            $InterviewItem = new InterviewItem(null, $item_id);
            $InterviewItem->delete();
        }
    break;

    case 'interviews_setdraft':
    case 'interviews_setpending':
    case 'interviews_setpublished':
コード例 #3
0
ファイル: ApplicantTest.php プロジェクト: itwapp/itwapp-php
 /**
  * @depends testCreateWithQuestionAndInterviewName
  */
 public function testCreateWithCallback()
 {
     $param = ["mail" => "*****@*****.**", "alert" => false, "questions" => [["content" => "question 1", "readingTime" => 60, "answerTime" => 60, "number" => 1]], "lang" => "en", "deadline" => intval((microtime(true) + ApplicantTest::$oneMonth) * 1000), "callback" => "http://mycustomeurl.com/done"];
     $res = Applicant::create($param);
     $this->assertEquals("*****@*****.**", $res->mail);
     $this->assertFalse($res->deleted);
     $this->assertCount(1, $res->questions);
     $this->assertEquals("http://mycustomeurl.com/done", $res->callback);
     Interview::delete($res->interview, array("withApplicant" => true));
     $app = Applicant::findOne($res->id);
     $this->assertTrue($app->deleted);
 }