You are here

public function AnswersBestTestCase::testNormalConfig in Answers 7.4

Test Answers config.

File

answers_best_answer/answers_best_answer.test, line 41
Tests for answers_best_answer.module.

Class

AnswersBestTestCase
Tests the functionality of the answers_userpoints module admin settings.

Code

public function testNormalConfig() {
  $langcode = LANGUAGE_NONE;
  $big_user = $this
    ->drupalCreateUser(array(
    'administer content types',
  ));
  $this
    ->drupalLogin($big_user);
  $this
    ->drupalGet('admin/config/content/answers');
  $this
    ->assertResponse(200);
  $config = array(
    'answers_best_answer_lock_questions_p' => FALSE,
    'answers_best_answer_lock_choice_p' => FALSE,
  );
  $this
    ->drupalPost('admin/config/content/answers', $config, 'Save configuration');
  $this
    ->drupalGet('node/add/answers-question');
  $question = array();
  $question['title'] = 'Woodchucks';
  $question["body[{$langcode}][0][value]"] = "How much wood could a woodchuck chuck?";
  $this
    ->drupalPost('node/add/answers-question', $question, 'Save');
  $answer = array();
  $answer["body[{$langcode}][0][value]"] = "Exactly 42 cords of wood.";
  $this
    ->drupalPost('node/1', $answer, 'Save');
  $this
    ->clickLink('Best');
  $this
    ->assertNoText('Note: This question is locked.');
  $this
    ->clickLink('Unbest');
}