function ConfigOtherModuleTest::testUninstall

Same name and namespace in other branches
  1. 9 core/modules/config/tests/src/Functional/ConfigOtherModuleTest.php \Drupal\Tests\config\Functional\ConfigOtherModuleTest::testUninstall()
  2. 8.9.x core/modules/config/tests/src/Functional/ConfigOtherModuleTest.php \Drupal\Tests\config\Functional\ConfigOtherModuleTest::testUninstall()
  3. 10 core/modules/config/tests/src/Kernel/ConfigOtherModuleTest.php \Drupal\Tests\config\Kernel\ConfigOtherModuleTest::testUninstall()

Tests uninstalling Node module removes views which are dependent on it.

File

core/modules/config/tests/src/Kernel/ConfigOtherModuleTest.php, line 113

Class

ConfigOtherModuleTest
Tests default configuration provided by a module that does not own it.

Namespace

Drupal\Tests\config\Kernel

Code

public function testUninstall() : void {
    $this->installModule('views');
    $this->assertNull($this->getStorage('view')
        ->load('frontpage'), 'After installing Views, frontpage view which is dependant on the Node and Views modules does not exist.');
    $this->installModule('node');
    $this->assertNotNull($this->getStorage('view')
        ->load('frontpage'), 'After installing Node, frontpage view which is dependant on the Node and Views modules exists.');
    $this->uninstallModule('node');
    $this->assertNull($this->getStorage('view')
        ->load('frontpage'), 'After uninstalling Node, frontpage view which is dependant on the Node and Views modules does not exist.');
}

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