Пример #1
0
 public function lex_comment_updateStatus($commentId, $status)
 {
     return LexCommentCommands::updateCommentStatus($this->projectId, $commentId, $status);
 }
 /**
  * @expectedException Exception
  */
 public function testUpdateCommentStatus_InvalidStatus_Exception()
 {
     $environ = new LexiconMongoTestEnvironment();
     $environ->clean();
     $project = $environ->createProject(SF_TESTPROJECT, SF_TESTPROJECTCODE);
     $userId = $environ->createUser('joe', 'joe', 'joe');
     $regarding = array('field' => 'lexeme', 'fieldValue' => 'Word 1', 'inputSystem' => 'th', 'word' => '', 'meaning' => '');
     $data = array('id' => '', 'content' => 'hi there!', 'regarding' => $regarding);
     $commentId = LexCommentCommands::updateComment($project->id->asString(), $userId, $environ->website, $data);
     $comment = new LexCommentModel($project, $commentId);
     $this->assertEquals(LexCommentModel::STATUS_OPEN, $comment->status);
     // save data for rest of this test
     self::$save['environ'] = $environ;
     self::$save['commentId'] = $commentId;
     self::$save['comment'] = $comment;
     $environ->inhibitErrorDisplay();
     LexCommentCommands::updateCommentStatus($project->id->asString(), $commentId, 'malicious code; rm -rf');
     // nothing runs in the current test function after an exception. IJH 2014-11
 }