You are here

public function LingotekConfigSettingsDeleteOnDisassociateRemoval8218Test::testDeleteOnDisassociateRemoval in Lingotek Translation 8.2

Tests that the Lingotek metadata dependencies are updated correctly.

File

tests/src/Functional/Update/LingotekConfigSettingsDeleteOnDisassociateRemoval8218Test.php, line 28

Class

LingotekConfigSettingsDeleteOnDisassociateRemoval8218Test
Tests the upgrade path moving Lingotek profile from settings to config metadata.

Namespace

Drupal\Tests\lingotek\Functional\Update

Code

public function testDeleteOnDisassociateRemoval() {

  // The values we want to remove.
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('lingotek.settings');
  $this
    ->assertTrue($config
    ->get('preference.delete_tms_documents_upon_disassociation'));
  $this
    ->assertNotNull($config
    ->get('preference.delete_tms_documents_upon_disassociation'));
  $this
    ->runUpdates();

  // The values were removed as expected when expected.
  $config = $config_factory
    ->getEditable('lingotek.settings');
  $this
    ->assertNull($config
    ->get('preference.delete_tms_documents_upon_disassociation'));
}