public function AnswersTestCase::testDefaultAccess in Answers 7.4
Same name and namespace in other branches
- 7.3 answers.test \AnswersTestCase::testDefaultAccess()
Tests authenticated users permissions.
File
- ./
answers.test, line 119 - 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/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');
$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, 'Save');
$answer = array();
$answer["body[{$langcode}][0][value]"] = "Exactly 42 cords of wood.";
$this
->drupalPost('node/1', $answer, 'Save');
$this
->clickLink(t('Edit'), 1);
$answer["body[{$langcode}][0][value]"] = "As much wood as a woodchuck could chuck, If a woodchuck could chuck wood.";
$this
->drupalPost('node/2/edit', $answer, 'Save');
}