You are here

function Faq_AskTestCase::askQuestion in FAQ_Ask 7

1 call to Faq_AskTestCase::askQuestion()
BlockFaq_AskTestCase::testAskQuestionBlock in ./faq_ask.test
Ask a question via the block Does this: 1. Changes the block title on the ask a question block 2. Swithes it on 3. Posts a question via the block form using an asker user 4. Turns unanswered block off 5. Verifies question visibility to the answer…

File

./faq_ask.test, line 136
Test Faq_Ask functionality Base test class. All tests inherits this one Hugely based on code from the test file block.test by boombatower

Class

Faq_AskTestCase
Base class that is extended by test cases

Code

function askQuestion($asker) {

  // Fill in the Create FAQ node 1 form and post it
  $faq1 = array();
  $faq1['title'] = $this
    ->randomName(20);
  $faq1['taxonomy_' . $this->vocabulary->machine_name . '[und]'] = $this->term->name;

  // Add new term
  $faq1['detailed_question'] = $this
    ->randomName(80);
  $this
    ->drupalLogin($asker);
  $this
    ->drupalPost('node/add/faq', $faq1, t('Save'));

  // Check that new FAQ node has actually been created
  $this
    ->assertText(t('FAQ @title has been created.', array(
    '@title' => $faq1['title'],
  )));
  return $faq1;
}