You are here

function FaqAskCRUDTestClass::testUncategorizedQuestion in FAQ_Ask 6.2

File

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

Class

FaqAskCRUDTestClass

Code

function testUncategorizedQuestion() {
  $this
    ->drupalLogin($this->admin_user);

  // Categorize questions but only expert can categorize
  $this
    ->drupalPost('admin/settings/faq/ask', array(
    'faq_ask_categorize' => '1',
  ), t('Save configuration'));

  // Post a new question
  $this
    ->drupalLogin($this->faq_asker);

  // Fill in the Create FAQ node 1 form and post it
  $this->faq = array();
  $this->faq['title'] = $this
    ->randomName(8);
  $this->faq['detailed_question'] = $this
    ->randomName(16);
  $this->faq['faq_notify'] = TRUE;
  $this
    ->drupalPost('faq_ask', $this->faq, t('Save'));

  // Preview first
  // Check that new FAQ node has actually been created
  $this
    ->assertText(t('FAQ @title has been created.', array(
    '@title' => $this->faq['title'],
  )));
  $mails = $this
    ->drupalGetMails();
  foreach ($mails as $mail) {
    $this
      ->pass('<pre>' . print_r($mail, TRUE) . '</pre>');
  }
}