/** * */ public function testCreate() { require_once WCF_DIR . 'lib/data/contest/crew/ContestCrew.class.php'; // create group $this->deleteArray[] = $group = $this->createGroup(array(array('optionID' => ContestCrew::getOptionID(), 'optionValue' => true))); $this->deleteArray[] = $user = $this->createUser($group->groupID); require_once WCF_DIR . 'lib/data/contest/ContestEditor.class.php'; $this->deleteArray[] = $user = $this->createUser(); $this->deleteArray[] = $contest = ContestEditor::create($userID = $user->userID, $groupID = 0, $subject = __METHOD__ . ' subject', $message = __METHOD__ . ' message', $options = array(), $state = 'applied'); require_once WCF_DIR . 'lib/data/contest/jury/ContestJuryEditor.class.php'; $this->deleteArray[] = $jury = ContestJuryEditor::create($contestID = 0, $userID = $user->userID, $groupID = 0, $state = 'private'); }
/** * when entry is applied, there should be a todo for the contest crew to check it */ public function testTodoCrew() { require_once WCF_DIR . 'lib/data/contest/crew/ContestCrew.class.php'; // create group $this->deleteArray[] = $group = $this->createGroup(array(array('optionID' => ContestCrew::getOptionID(), 'optionValue' => true))); $this->deleteArray[] = $user = $this->createUser($group->groupID); $this->setCurrentUser($user); $this->contest->update($userID = 0, $groupID = 0, $subject = '', $message = '', $fromTime = '', $untilTime = '', $state = 'applied'); require_once WCF_DIR . 'lib/data/contest/crew/todo/ContestCrewTodoList.class.php'; $todo = new ContestCrewTodoList(); $todo->readObjects(); $task = array_pop($todo->getObjects()); $this->assertEquals($task->action, 'crew.contest.applied'); }