You are here

public function AnswersTestCase::testDefaultAccess in Answers 7.3

Same name and namespace in other branches
  1. 7.4 answers.test \AnswersTestCase::testDefaultAccess()

Tests authenticated users permissions.

File

./answers.test, line 131
Tests for answers.module.

Class

AnswersTestCase
Tests the functionality of the answers module.

Code

public function testDefaultAccess() {
  $langcode = LANGUAGE_NONE;
  $this
    ->drupalLogin($this->answersUser);
  $this
    ->drupalGet('node/add/question');
  $question = array();
  $question['title'] = 'Woodchucks';
  $question["body[{$langcode}][0][value]"] = "How much wood could a woodchuck chuck?";
  $this
    ->drupalPost('node/add/question', $question, 'Ask Your Question');
  $this
    ->clickLink(t('Edit'));
  $question = array();
  $question['title'] = 'How much wood?';
  $question["body[{$langcode}][0][value]"] = "How much wood could a woodchuck chuck, if a woodchuck could chuck wood?";
  $this
    ->drupalPost('node/1/edit', $question, 'Update Your Question');
  $answer = array();
  $answer['title'] = 'The Answer to everything!';
  $answer["body[{$langcode}][0][value]"] = "Exactly 42 cords of wood.";
  $this
    ->drupalPost('node/add/answer/1', $answer, 'Post Your Answer');
}