You are here

function SendgridIntegrationReportsTestCase::setUp in SendGrid Integration 7

Implements setUp().

Overrides SendgridIntegrationTestCase::setUp

File

modules/sendgrid_integration_reports/tests/sendgrid_integration_reports.test, line 27
Contains tests for the Sendgrid Integration Reports module.

Class

SendgridIntegrationReportsTestCase
Test case.

Code

function setUp() {

  // Call the parent with an array of modules to enable for the test.
  $modules = [
    'sendgrid_integration',
    'sendgrid_integration_reports',
  ];
  parent::setUp($modules);

  // TODO: perform additional setup tasks here if required.
  // Create a generic authenticated user.
  $this->web_user = $this
    ->drupalCreateUser();

  // Create an admin user and log them in.
  $this->admin_user = $this
    ->drupalCreateUser([
    'access content',
    'create page content',
    'edit own page content',
    'administer users',
    'administer permissions',
  ]);
  $this
    ->drupalLogin($this->admin_user);

  // Set the role as admin for the admin user just created.
  $this
    ->drupalPost('user/' . $this->admin_user->uid . '/edit', [
    'roles[3]' => TRUE,
  ], t('Save'));
}