You are here

public function ConfigDependenciesTest::testOnDependencyRemovalRemoveUnrelatedDependency in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php \Drupal\Tests\rest\Kernel\Entity\ConfigDependenciesTest::testOnDependencyRemovalRemoveUnrelatedDependency()
  2. 10 core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php \Drupal\Tests\rest\Kernel\Entity\ConfigDependenciesTest::testOnDependencyRemovalRemoveUnrelatedDependency()

@covers ::onDependencyRemoval @covers ::onDependencyRemovalForMethodGranularity @covers ::onDependencyRemovalForResourceGranularity

@dataProvider providerBasicDependencies

File

core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php, line 45

Class

ConfigDependenciesTest
@coversDefaultClass \Drupal\rest\Entity\ConfigDependencies

Namespace

Drupal\Tests\rest\Kernel\Entity

Code

public function testOnDependencyRemovalRemoveUnrelatedDependency(array $configuration) {
  $config_dependencies = new ConfigDependencies([
    'hal_json' => 'hal',
    'json' => 'serialization',
  ], [
    'basic_auth' => 'basic_auth',
  ]);
  $rest_config = RestResourceConfig::create($configuration);
  $this
    ->assertFalse($config_dependencies
    ->onDependencyRemoval($rest_config, [
    'module' => [
      'node',
    ],
  ]));
  $this
    ->assertEquals($configuration['configuration'], $rest_config
    ->get('configuration'));
}