You are here

function FeedbackTestCase::testFeedbackMessage in Feedback 7.2

Test a basic feedback message.

File

tests/feedback.test, line 34
Tests for Feedback module.

Class

FeedbackTestCase
Test basic Feedback functionality.

Code

function testFeedbackMessage() {
  $message = $this
    ->randomString();
  $edit = array(
    'message' => $message,
  );
  $this
    ->drupalPost('node', $edit, t('Send feedback'));

  // Verify the message was recorded.
  $this
    ->drupalLogin($this->admin_user);
  $this
    ->drupalGet('admin/reports/feedback');
  $this
    ->assertRaw(check_plain($message), t('Message found.'));
  $this
    ->assertText('node', t('Originating system path found.'));
  $this
    ->assertLinkByHref(url('node', array(
    'absolute' => TRUE,
  )), 0, t('Originating absolute URL found.'));

  // Verify that we can process the message.
  $edit = array(
    'feedback-messages[0][1]' => TRUE,
  );
  $this
    ->drupalPost(NULL, $edit, t('Submit'));
  $this
    ->assertFieldByName('feedback-messages[1][1]', 1, t('Processed message found.'));
}