function NodeTranslationUITest::doUninstallTest

Same name in other branches
  1. 8.9.x core/modules/node/tests/src/Functional/NodeTranslationUITest.php \Drupal\Tests\node\Functional\NodeTranslationUITest::doUninstallTest()
  2. 10 core/modules/node/tests/src/Functional/NodeTranslationUITest.php \Drupal\Tests\node\Functional\NodeTranslationUITest::doUninstallTest()
  3. 11.x core/modules/node/tests/src/Functional/NodeTranslationUITest.php \Drupal\Tests\node\Functional\NodeTranslationUITest::doUninstallTest()

Tests uninstalling content_translation.

1 call to NodeTranslationUITest::doUninstallTest()
NodeTranslationUITest::testTranslationUI in core/modules/node/tests/src/Functional/NodeTranslationUITest.php
Tests the basic translation UI.

File

core/modules/node/tests/src/Functional/NodeTranslationUITest.php, line 471

Class

NodeTranslationUITest
Tests the Node Translation UI.

Namespace

Drupal\Tests\node\Functional

Code

protected function doUninstallTest() {
    // Delete all the nodes so there is no data.
    $nodes = Node::loadMultiple();
    foreach ($nodes as $node) {
        $node->delete();
    }
    $language_count = count(\Drupal::configFactory()->listAll('language.content_settings.'));
    \Drupal::service('module_installer')->uninstall([
        'content_translation',
    ]);
    $this->rebuildContainer();
    $this->assertCount($language_count, \Drupal::configFactory()->listAll('language.content_settings.'), 'Languages have been fixed rather than deleted during content_translation uninstall.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.