You are here

public function ConfigDependenciesTest::testSchemeDependencies in Workbench Email 8

Same name and namespace in other branches
  1. 2.x tests/src/Kernel/ConfigDependenciesTest.php \Drupal\Tests\workbench_email\Kernel\ConfigDependenciesTest::testSchemeDependencies()

Tests scheme dependencies.

File

tests/src/Kernel/ConfigDependenciesTest.php, line 74

Class

ConfigDependenciesTest
Defines a class for testing config dependencies.

Namespace

Drupal\Tests\workbench_email\Kernel

Code

public function testSchemeDependencies() {
  $this
    ->assertEquals([
    'config' => [
      'field.storage.node.field_email',
      'user.role.editor',
    ],
  ], $this->template
    ->getDependencies());

  // Delete the editor role.
  $this->editorRole
    ->delete();
  $this->template = $this
    ->loadUnchangedTemplate($this->template
    ->id());
  $this
    ->assertEquals([
    'config' => [
      'field.storage.node.field_email',
    ],
  ], $this->template
    ->getDependencies());

  // Delete the email field.
  FieldConfig::load('node.test.field_email')
    ->delete();
  $this->template = $this
    ->loadUnchangedTemplate($this->template
    ->id());
  $this
    ->assertEquals([], $this->template
    ->getDependencies());
}