You are here

public function ViewsTest::setUp in Message Subscribe 8

Overrides BrowserTestBase::setUp

File

message_subscribe_email/tests/src/Functional/ViewsTest.php, line 41

Class

ViewsTest
Tests the views provided by this module for the UI.

Namespace

Drupal\Tests\message_subscribe_email\Functional

Code

public function setUp() {
  parent::setUp();
  $this->flagService = $this->container
    ->get('flag');
  $this->messageSubscribers = $this->container
    ->get('message_subscribe.subscribers');

  // Enable flags.
  foreach ([
    'node',
    'og',
    'term',
    'user',
  ] as $entity_type) {
    foreach ([
      'email',
      'subscribe',
    ] as $flag_type) {
      if ($flag = $this->flagService
        ->getFlagById($flag_type . '_' . $entity_type)) {
        $flag
          ->enable();
        $flag
          ->save();
      }
    }
  }
}