diff --git a/core/modules/system/src/Tests/Installer/ConfigAfterInstallerTestBase.php b/core/modules/system/src/Tests/Installer/ConfigAfterInstallerTestBase.php index aa3ec3e..7531424 100644 --- a/core/modules/system/src/Tests/Installer/ConfigAfterInstallerTestBase.php +++ b/core/modules/system/src/Tests/Installer/ConfigAfterInstallerTestBase.php @@ -14,7 +14,7 @@ use Drupal\simpletest\InstallerTestBase; /** - * Provides a class for install profiles to check its installed config. + * Provides a class for install profiles to check their installed config. */ abstract class ConfigAfterInstallerTestBase extends InstallerTestBase { diff --git a/core/tests/Drupal/KernelTests/AssertConfigTrait.php b/core/tests/Drupal/KernelTests/AssertConfigTrait.php index 437cf99..24d393e 100644 --- a/core/tests/Drupal/KernelTests/AssertConfigTrait.php +++ b/core/tests/Drupal/KernelTests/AssertConfigTrait.php @@ -23,7 +23,7 @@ * The config name to check. * @param array $skipped_config * An array of skipped config, keyed by string. If the value is TRUE, the - * entire file will be ignored, otherwise its an array of strings which are + * entire file will be ignored, otherwise it's an array of strings which are * ignored. * * @throws \Exception diff --git a/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php b/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php index 0ee34e1..8efed71 100644 --- a/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php +++ b/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php @@ -7,7 +7,6 @@ namespace Drupal\KernelTests\Config; -use Drupal\Component\Diff\Diff; use Drupal\Component\FileCache\FileCacheFactory; use Drupal\Core\Config\FileStorage; use Drupal\Core\Config\InstallStorage; @@ -15,7 +14,6 @@ use Drupal\Core\Site\Settings; use Drupal\KernelTests\AssertConfigTrait; use Drupal\KernelTests\KernelTestBase; -use Drupal\user\Entity\User; /** * Tests that the installed config matches the default config. @@ -32,11 +30,16 @@ class DefaultConfigTest extends KernelTestBase { public static $modules = ['system', 'user']; /** + * Time limit for the test. + */ + protected $timeLimit = 120; + + /** * {@inheritdoc} */ protected function setUp() { // @todo Extra hack to avoid test fails, remove this once - // https://www.drupal.org/node/2553661 is fixed. + // https://www.drupal.org/node/2553661 is fixed. FileCacheFactory::setPrefix(Settings::getApcuPrefix('file_cache', $this->root)); parent::setUp(); @@ -54,9 +57,15 @@ protected function setUp() { } /** + * Tests if installed config is equal to the exported config. + * * @dataProvider providerTestModuleConfig */ public function testModuleConfig($module) { + // We're testing a lot of modules. Allow sufficient time for the test to + // run. + drupal_set_time_limit($this->timeLimit); + /** @var \Drupal\Core\Extension\ModuleInstallerInterface $module_installer */ $module_installer = $this->container->get('module_installer'); /** @var \Drupal\Core\Config\StorageInterface $active_config_storage */ @@ -94,6 +103,12 @@ public function testModuleConfig($module) { } } + /** + * Test data provider for ::testModuleConfig(). + * + * @return array + * An array of module names to test. + */ public function providerTestModuleConfig() { $module_dirs = array_keys(iterator_to_array(new \FilesystemIterator(__DIR__ . '/../../../../modules/'))); $module_names = array_map(function($path) {