You are here

protected function SharedTestFunctions::createContent in Notify 7

14 calls to SharedTestFunctions::createContent()
TestNotify::testCreateOldArticlesLongCron in ./notify.test
TestNotify::testCreateOnlyUnpublishedArticles in ./notify.test
TestNotify::testCreateThreeOrdinaryArticles in ./notify.test
TestNotify::testCronNever in ./notify.test
TestNotify::testOldAndNewArticles in ./notify.test

... See full list

File

./notify.test, line 50
Automated tests for notify.

Class

SharedTestFunctions
@file Automated tests for notify.

Code

protected function createContent($numb = 1, $author = NULL, $published = TRUE, $date = NULL) {
  for ($ii = 1; $ii <= $numb; $ii++) {

    // Post an article.
    $edit = array();
    $edit['title'] = 'Art: ' . $this
      ->randomName(8);
    $edit['body[und][0][value]'] = $this
      ->randomName(7) . ' ' . $this
      ->randomName(9) . '.';
    if ($date) {
      $edit["date"] = $date;
    }
    if (isset($author)) {
      $edit['name'] = $author;
    }
    if (!$published) {
      $edit['status'] = FALSE;
    }
    $this
      ->drupalPost('node/add/article', $edit, t('Save'));
    $this
      ->assertText(t('Article @title has been created.', array(
      '@title' => $edit['title'],
    )));
  }
}