Commit 50ca1107 authored by effulgentsia's avatar effulgentsia

Issue #2678770 by alexpott, tstoeckler, Gábor Hojtsy: Random fail with third...

Issue #2678770 by alexpott, tstoeckler, Gábor Hojtsy: Random fail with third party shortcut settings schema on seven theme
parent 133989c3
......@@ -64,6 +64,6 @@ function shortcut_uninstall() {
// Theme settings are not configuration entities and cannot depend on modules
// so to unset a module-specific setting, we need to unset it with logic.
if (\Drupal::service('theme_handler')->themeExists('seven')) {
\Drupal::configFactory()->getEditable('seven.settings')->clear('third_party_settings.shortcut.module_link')->save(TRUE);
\Drupal::configFactory()->getEditable('seven.settings')->clear('third_party_settings.shortcut')->save(TRUE);
}
}
<?php
/**
* @file
* Contains \Drupal\Tests\shortcut\Kernel\ShortcutSevenIntegrationTest.
*/
namespace Drupal\Tests\shortcut\Kernel;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests shortcut_install() and shortcut_uninstall().
*
* @group shortcut
*/
class ShortcutSevenIntegrationTest extends KernelTestBase {
public static $modules = ['system'];
/**
* Tests shortcut_install() and shortcut_uninstall().
*/
public function testInstallUninstall() {
// Install seven.
\Drupal::service('theme_installer')->install(['seven']);
$this->assertNull($this->config('seven.settings')->get('third_party_settings.shortcut'), 'There are no shortcut settings in seven.settings.');
\Drupal::service('module_installer')->install(['shortcut']);
$this->assertTrue($this->config('seven.settings')->get('third_party_settings.shortcut.module_link'), 'The shortcut module_link setting is in seven.settings.');
\Drupal::service('module_installer')->uninstall(['shortcut']);
$this->assertNull($this->config('seven.settings')->get('third_party_settings.shortcut'), 'There are no shortcut settings in seven.settings.');
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment