You are here

public function ConfigSelectorProfileTest::testProfileInstall in Configuration selector 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/ConfigSelectorProfileTest.php \Drupal\Tests\config_selector\Functional\ConfigSelectorProfileTest::testProfileInstall()

Tests the profile supplied configuration can be selected.

File

tests/src/Functional/ConfigSelectorProfileTest.php, line 22

Class

ConfigSelectorProfileTest
Tests the profile supplied configuration can be selected.

Namespace

Drupal\Tests\config_selector\Functional

Code

public function testProfileInstall() {

  /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface[] $configs */
  $configs = \Drupal::entityTypeManager()
    ->getStorage('config_test')
    ->loadMultiple();
  $this
    ->assertTrue($configs['feature_a_five']
    ->status());

  // The profile supplies configuration with a higher priority.
  $this
    ->assertFalse($configs['feature_a_two']
    ->status());

  // Lower priority than feature_a_two.
  $this
    ->assertFalse($configs['feature_a_one']
    ->status());

  // Lower priority than feature_a_two.
  $this
    ->assertFalse($configs['feature_a_three']
    ->status());

  // Higher priority but it is disabled in default configuration.
  $this
    ->assertFalse($configs['feature_a_four']
    ->status());

  // Module supplied configuration.
  $this
    ->assertTrue($configs['feature_b_two']
    ->status());
  $this
    ->assertFalse($configs['feature_b_one']
    ->status());
  $this
    ->assertTrue($configs['feature_c_one']
    ->status());

  // Profile supplied configuration.
  $this
    ->assertTrue($configs['feature_d_two']
    ->status());
  $this
    ->assertFalse($configs['feature_d_one']
    ->status());
}