Commit 06eed305 authored by catch's avatar catch

Issue #1480866 by tstoeckler, adamdicarlo, sheise: Follow-up for Add...

Issue #1480866 by tstoeckler, adamdicarlo, sheise: Follow-up for Add type-hinting and parameter type docmentation for comment objects.
parent 99a456c3
......@@ -51,7 +51,7 @@ function comment_reply(Node $node, $pid = NULL) {
if (user_access('access comments')) {
// Load the parent comment.
$comment = comment_load($pid);
if ($comment->status = COMMENT_PUBLISHED) {
if ($comment->status == COMMENT_PUBLISHED) {
// If that comment exists, make sure that the current comment and the
// parent comment both belong to the same parent node.
if ($comment->nid != $node->nid) {
......
......@@ -123,6 +123,12 @@ class CommentInterfaceTest extends CommentTestBase {
$this->assertTrue($this->commentExists($reply, TRUE), t('Page two exists. %s'));
$this->setCommentsPerPage(50);
// Attempt to reply to an unpublished comment.
$reply_loaded->status = COMMENT_NOT_PUBLISHED;
$reply_loaded->save();
$this->drupalGet('comment/reply/' . $this->node->nid . '/' . $reply_loaded->cid);
$this->assertText(t('The comment you are replying to does not exist.'), 'Replying to an unpublished comment');
// Attempt to post to node with comments disabled.
$this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_HIDDEN));
$this->assertTrue($this->node, t('Article node created.'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment