You are here

protected function SimplenewsPersonalizationFormsTest::setUp in Simplenews 8.2

Same name and namespace in other branches
  1. 3.x tests/src/Functional/SimplenewsPersonalizationFormsTest.php \Drupal\Tests\simplenews\Functional\SimplenewsPersonalizationFormsTest::setUp()

Overrides SimplenewsTestBase::setUp

File

tests/src/Functional/SimplenewsPersonalizationFormsTest.php, line 25

Class

SimplenewsPersonalizationFormsTest
Tests crucial aspects of Subscriber fieldability and User field sync.

Namespace

Drupal\Tests\simplenews\Functional

Code

protected function setUp() {
  parent::setUp();
  $this
    ->addField('string', 'field_shared', 'user');
  $this
    ->addField('string', 'field_shared', 'simplenews_subscriber');
  Role::load('anonymous')
    ->grantPermission('subscribe to newsletters')
    ->grantPermission('access user profiles')
    ->save();
  Role::load('authenticated')
    ->grantPermission('subscribe to newsletters')
    ->save();
  $this->admin = $this
    ->drupalCreateUser([
    'administer users',
  ]);
}