Unverified Commit 3a2ddfed authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3281440 by _shY, nod_: Update Shortcut tests to not use Bartik and Seven

(cherry picked from commit 02656d5d)
(cherry picked from commit 4d6ae45b)
parent c2d7ae96
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -148,8 +148,8 @@ public function testShortcutLinkAdd() {
   * Tests that the "add to shortcut" and "remove from shortcut" links work.
   */
  public function testShortcutQuickLink() {
    \Drupal::service('theme_installer')->install(['seven']);
    $this->config('system.theme')->set('admin', 'seven')->save();
    \Drupal::service('theme_installer')->install(['claro']);
    $this->config('system.theme')->set('admin', 'claro')->save();
    $this->config('node.settings')->set('use_admin_theme', '1')->save();
    $this->container->get('router.builder')->rebuild();

@@ -197,7 +197,7 @@ public function testShortcutQuickLink() {
    $this->clickLink('Add to Default shortcuts');
    $this->assertSession()->pageTextContains('Added a shortcut for Create Article.');

    $this->config('system.theme')->set('default', 'seven')->save();
    $this->config('system.theme')->set('default', 'claro')->save();
    $this->drupalGet('node/' . $this->node->id());
    $title = $this->node->getTitle();

@@ -315,9 +315,9 @@ public function testShortcutLinkDelete() {
   */
  public function testNoShortcutLink() {
    // Change to a theme that displays shortcuts.
    \Drupal::service('theme_installer')->install(['seven']);
    \Drupal::service('theme_installer')->install(['claro']);
    $this->config('system.theme')
      ->set('default', 'seven')
      ->set('default', 'claro')
      ->save();

    $this->drupalGet('page-that-does-not-exist');
@@ -343,9 +343,9 @@ public function testNoShortcutLink() {
   */
  public function testAccessShortcutsPermission() {
    // Change to a theme that displays shortcuts.
    \Drupal::service('theme_installer')->install(['seven']);
    \Drupal::service('theme_installer')->install(['claro']);
    $this->config('system.theme')
      ->set('default', 'seven')
      ->set('default', 'claro')
      ->save();

    // Add cron to the default shortcut set.
+6 −6
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
 *
 * @group shortcut
 */
class ShortcutSevenIntegrationTest extends KernelTestBase {
class ShortcutClaroIntegrationTest extends KernelTestBase {

  protected static $modules = ['system'];

@@ -17,15 +17,15 @@ class ShortcutSevenIntegrationTest extends KernelTestBase {
   * 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.');
    // Install claro.
    \Drupal::service('theme_installer')->install(['claro']);
    $this->assertNull($this->config('claro.settings')->get('third_party_settings.shortcut'), 'There are no shortcut settings in claro.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.');
    $this->assertTrue($this->config('claro.settings')->get('third_party_settings.shortcut.module_link'), 'The shortcut module_link setting is in claro.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.');
    $this->assertNull($this->config('claro.settings')->get('third_party_settings.shortcut'), 'There are no shortcut settings in claro.settings.');
  }

}