You are here

function CommentModuleTestCase::testFormOnPage in SimpleTest 6

Test comment form on node page.

File

tests/comment_module.test, line 82

Class

CommentModuleTestCase

Code

function testFormOnPage() {

  // Enabled comment form on node page.
  $this
    ->drupalLoginUser($this->admin_user);
  $this
    ->set_comment_form(TRUE);
  $this
    ->drupalGet('logout');

  // Submit comment through node form.
  $this
    ->drupalLoginUser($this->web_user);
  $this
    ->drupalGet('node/' . $this->node->nid);
  $form_comment = $this
    ->post_comment(NULL, $this
    ->randomName(), $this
    ->randomName());
  $this
    ->assertTrue($this
    ->comment_exists($form_comment), 'Form comment found.');

  // Disable comment form on node page.
  $this
    ->drupalGet('logout');
  $this
    ->drupalLoginUser($this->admin_user);
  $this
    ->set_comment_form(FALSE);
}