public function lex_comment_delete($commentId) { return LexCommentCommands::deleteComment($this->projectId, $this->userId, $this->website, $commentId); }
public function testDeleteComment_CommentMarkedDeletedAndNotInList() { $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->assertFalse($comment->isDeleted); $commentList = new LexCommentListModel($project); $commentList->read(); $this->assertEquals(1, $commentList->count); LexCommentCommands::deleteComment($project->id->asString(), $userId, $environ->website, $commentId); $commentList->read(); $comment->read($commentId); $this->assertEquals(0, $commentList->count); $this->assertTrue($comment->isDeleted); }