stable

Clone or download

Read-only

refactor: Have a business object to create comments

No functional change expected when creating a new comment through the REST API. Notes: Having a dedicated object for the creation of comments lets us avoid "bogus" values for Comment, like the "0" ID. Constraints at creation and in the rest of the code are usually different: there is no ID before creation, and other pieces do not exist yet. We should have separate business objects to deal with those different constraints. part of story #32316 Update comments Change-Id: I8ae5caf016dab2acaafd8c4e536443824ff5e0d7

Modified Files

Name
M plugins/pullrequest/include/PullRequest/Comment/Comment.php +4 −4 Go to diff View file
M plugins/pullrequest/include/PullRequest/Comment/CommentCreator.php +9 −16 Go to diff View file
M plugins/pullrequest/include/PullRequest/Comment/CreateComment.php +1 −8 Go to diff View file
M plugins/pullrequest/include/PullRequest/Comment/Dao.php +12 −18 Go to diff View file
A plugins/pullrequest/include/PullRequest/Comment/NewComment.php +44 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/Comment/POSTCommentHandler.php +9 −12 Go to diff View file
M plugins/pullrequest/tests/integration/Comment/CommentDAOTest.php +20 −20 Go to diff View file
M plugins/pullrequest/tests/unit/Comment/CommentCreatorTest.php +3 −3 Go to diff View file
M plugins/pullrequest/tests/unit/Comment/CommentTest.php +39 −0 Go to diff View file
A plugins/pullrequest/tests/unit/Tests/Builders/NewCommentTestBuilder.php +75 −0 Go to diff View file
M plugins/pullrequest/tests/unit/Tests/Builders/NewInlineCommentTestBuilder.php +1 −1 Go to diff View file
M plugins/pullrequest/tests/unit/Tests/Stub/CreateCommentStub.php +4 −8 Go to diff View file