You are here

protected function TokenNotificationsTest::setUp in Content Moderation Notifications 8.3

Overrides NotificationsTest::setUp

File

tests/src/Kernel/TokenNotificationsTest.php, line 31

Class

TokenNotificationsTest
Tests with the contrib token module enabled.

Namespace

Drupal\Tests\content_moderation_notifications\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installEntitySchema('node');
  $this
    ->installSchema('node', [
    'node_access',
  ]);
  $this
    ->installConfig([
    'filter',
    'node',
    'system',
  ]);
  $this
    ->createContentType([
    'type' => 'article',
  ]);

  // Setup site email.
  $this
    ->config('system.site')
    ->set('mail', 'admin@example.com')
    ->save();
  $this
    ->enableModeration('node', 'article');

  /** @var \Drupal\workflows\WorkflowInterface $workflow */
  $workflow = Workflow::load('editorial');
  $workflow
    ->getTypePlugin()
    ->addEntityTypeAndBundle('node', 'article');
  $workflow
    ->save();
}