diff core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php	Wed Nov 29 16:09:58 2017 +0000
@@ -0,0 +1,42 @@
+<?php
+
+namespace Drupal\Tests\block\Functional;
+
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Tests the block administration page for a non-default theme.
+ *
+ * @group block
+ */
+class NonDefaultBlockAdminTest extends BrowserTestBase {
+
+  /**
+   * Modules to install.
+   *
+   * @var array
+   */
+  public static $modules = ['block'];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    $this->drupalPlaceBlock('local_tasks_block');
+  }
+
+  /**
+   * Test non-default theme admin.
+   */
+  public function testNonDefaultBlockAdmin() {
+    $admin_user = $this->drupalCreateUser(['administer blocks', 'administer themes']);
+    $this->drupalLogin($admin_user);
+    $new_theme = 'bartik';
+    \Drupal::service('theme_handler')->install([$new_theme]);
+    $this->drupalGet('admin/structure/block/list/' . $new_theme);
+    $this->assertText('Bartik(' . t('active tab') . ')', 'Tab for non-default theme found.');
+  }
+
+}