You are here

function SimplenewsStatisticsTestCase::setUp in Simplenews Statistics 7

Same name and namespace in other branches
  1. 7.2 tests/simplenews_statistics.test \SimplenewsStatisticsTestCase::setUp()

File

tests/simplenews_statistics.test, line 26
Simplenews Statistics test functions.

Class

SimplenewsStatisticsTestCase
@file Simplenews Statistics test functions.

Code

function setUp($modules = array()) {
  $modules = array_merge(array(
    'simplenews_statistics',
  ), $modules);
  parent::setUp($modules);

  /**
   * @var $user
   *   Create a user with all simplenews, simplenews statistics and core permissions
   */
  $this->user = $this
    ->drupalCreateUser(array(
    'administer newsletter statistics',
    'view newsletters statistics',
    'administer newsletters',
    'send newsletter',
    'administer nodes',
    'administer simplenews subscriptions',
    'create simplenews content',
    'edit any simplenews content',
    'view own unpublished content',
    'delete any simplenews content',
  ));
  $this
    ->drupalLogin($this->user);

  // Subscribe a few users. Use a higher amount because we want to test statistics
  $this
    ->setUpSubscribers(37);
}