public function AnswersBestTestCase::testChangeBestAnswer in Answers 7.4
Test changing best answer.
File
- answers_best_answer/
answers_best_answer.test, line 182 - Tests for answers_best_answer.module.
Class
- AnswersBestTestCase
- Tests the functionality of the answers_userpoints module admin settings.
Code
public function testChangeBestAnswer() {
$langcode = LANGUAGE_NONE;
$this
->drupalLogin($this->answersUser);
$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');
$answer["body[{$langcode}][0][value]"] = "Woodchucks do not chuckwood.";
$this
->drupalPost('node/1', $answer, 'Save');
$this
->clickLink('Best');
}