public function testVoteUp_TwoVotes_NoChange()
 {
     $mte = new MongoTestEnvironment();
     $e = new UserVoteTestEnvironment();
     $e->create();
     $dto = $e->addAnswer('Some answer');
     //         var_dump($dto, $e->answerId);
     $answer0 = $dto[$e->answerId];
     $this->assertEqual(0, $answer0['score']);
     $dto = QuestionCommands::voteUp($e->userId, $e->projectId, $e->questionId, $e->answerId);
     //         var_dump($dto, $e->answerId);
     $dto = QuestionCommands::voteUp($e->userId, $e->projectId, $e->questionId, $e->answerId);
     //         var_dump($dto, $e->answerId);
     $answer1 = $dto[$e->answerId];
     $this->assertEqual(1, $answer1['score']);
 }
Пример #2
0
 public function answer_vote_up($questionId, $answerId)
 {
     return QuestionCommands::voteUp($this->_userId, $this->_projectId, $questionId, $answerId);
 }