You are here

public function ModuleTestBase::assertNoModuleConfig in Drupal 8

Same name in this branch
  1. 8 core/modules/system/src/Tests/Module/ModuleTestBase.php \Drupal\system\Tests\Module\ModuleTestBase::assertNoModuleConfig()
  2. 8 core/modules/system/tests/src/Functional/Module/ModuleTestBase.php \Drupal\Tests\system\Functional\Module\ModuleTestBase::assertNoModuleConfig()
Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Module/ModuleTestBase.php \Drupal\Tests\system\Functional\Module\ModuleTestBase::assertNoModuleConfig()
  2. 10 core/modules/system/tests/src/Functional/Module/ModuleTestBase.php \Drupal\Tests\system\Functional\Module\ModuleTestBase::assertNoModuleConfig()

Asserts that no configuration exists for a given module.

Parameters

string $module: The name of the module.

Return value

bool TRUE if no configuration was found, FALSE otherwise.

2 calls to ModuleTestBase::assertNoModuleConfig()
ConfigImportAllTest::testInstallUninstall in core/modules/config/tests/src/Functional/ConfigImportAllTest.php
Tests that a fixed set of modules can be installed and uninstalled.
InstallUninstallTest::assertSuccessfulUninstall in core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php
Uninstalls a module and asserts that it was done correctly.

File

core/modules/system/tests/src/Functional/Module/ModuleTestBase.php, line 146

Class

ModuleTestBase
Helper class for module test cases.

Namespace

Drupal\Tests\system\Functional\Module

Code

public function assertNoModuleConfig($module) {
  $names = \Drupal::configFactory()
    ->listAll($module . '.');
  return $this
    ->assertEmpty($names, new FormattableMarkup('No configuration found for @module module.', [
    '@module' => $module,
  ]));
}