You are here

public function LingotekConfigSubscriberTest::testDeletingTranslatedConfig in Lingotek Translation 3.7.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekConfigSubscriberTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigSubscriberTest::testDeletingTranslatedConfig()
  2. 4.0.x tests/src/Functional/LingotekConfigSubscriberTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigSubscriberTest::testDeletingTranslatedConfig()
  3. 3.0.x tests/src/Functional/LingotekConfigSubscriberTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigSubscriberTest::testDeletingTranslatedConfig()
  4. 3.1.x tests/src/Functional/LingotekConfigSubscriberTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigSubscriberTest::testDeletingTranslatedConfig()
  5. 3.2.x tests/src/Functional/LingotekConfigSubscriberTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigSubscriberTest::testDeletingTranslatedConfig()
  6. 3.3.x tests/src/Functional/LingotekConfigSubscriberTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigSubscriberTest::testDeletingTranslatedConfig()
  7. 3.4.x tests/src/Functional/LingotekConfigSubscriberTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigSubscriberTest::testDeletingTranslatedConfig()
  8. 3.5.x tests/src/Functional/LingotekConfigSubscriberTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigSubscriberTest::testDeletingTranslatedConfig()
  9. 3.6.x tests/src/Functional/LingotekConfigSubscriberTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigSubscriberTest::testDeletingTranslatedConfig()
  10. 3.8.x tests/src/Functional/LingotekConfigSubscriberTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigSubscriberTest::testDeletingTranslatedConfig()

File

tests/src/Functional/LingotekConfigSubscriberTest.php, line 58

Class

LingotekConfigSubscriberTest
Tests config overrides in settings.php are possible .

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testDeletingTranslatedConfig() {
  $this
    ->goToConfigBulkManagementForm('block');
  $this
    ->clickLink('EN');
  $data = json_decode(\Drupal::state()
    ->get('lingotek.uploaded_content', '[]'), TRUE);
  $this
    ->verbose(var_export($data, TRUE));
  $this
    ->assertText('Title block uploaded successfully');
  $this
    ->clickLink('ES');
  $this
    ->clickLink('ES');
  $this
    ->clickLink('ES');
  $this
    ->assertText('Translation to es_MX downloaded successfully');

  // Navigate to the Extend page.
  $this
    ->drupalGet('/admin/modules');
  $this
    ->assertSession()
    ->checkboxChecked('modules[block][enable]');
  $this
    ->clickLink('Uninstall');

  // Post the form uninstalling the lingotek module.
  $edit = [
    'uninstall[block]' => '1',
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Uninstall');

  // We get an advice and we can confirm.
  $this
    ->assertText('The following modules will be completely uninstalled from your site, and all data from these modules will be lost!');
  $this
    ->assertSession()
    ->responseContains('Block');
  $this
    ->assertSession()
    ->responseContains('The listed configuration will be deleted.');
  $this
    ->assertSession()
    ->responseContains('Lingotek Config Metadata');
  $this
    ->assertSession()
    ->responseContains('block.block_1');
  $this
    ->drupalPostForm(NULL, [], 'Uninstall');
  $this
    ->assertSession()
    ->responseContains('The selected modules have been uninstalled.');
}