You are here

function SendgridIntegrationTestCase::setUp in SendGrid Integration 8.2

Same name and namespace in other branches
  1. 8 tests/sendgrid_integration.test \SendgridIntegrationTestCase::setUp()
  2. 7 tests/sendgrid_integration.test \SendgridIntegrationTestCase::setUp()

File

tests/sendgrid_integration.test, line 41
Contains tests for the Sendgrid Integration module.

Class

SendgridIntegrationTestCase
Test case.

Code

function setUp() {

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

  // 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'));
}