Commit bbb4de91 authored by alexpott's avatar alexpott

Issue #2350823 by lauriii, jhedstrom, Tim Bozeman, cilefen, davidhernandez,...

Issue #2350823 by lauriii, jhedstrom, Tim Bozeman, cilefen, davidhernandez, inqui, Cottser, xjm: Use the Classy theme in the Testing profile
parent d8776af5
......@@ -74,7 +74,7 @@ public function testBlockConfigSchema() {
$id = strtolower($this->randomMachineName());
$block = Block::create(array(
'id' => $id,
'theme' => 'stark',
'theme' => 'classy',
'weight' => 00,
'status' => TRUE,
'region' => 'content',
......
......@@ -190,7 +190,7 @@ public function testBlockThemeSelector() {
// Install all themes.
\Drupal::service('theme_handler')->install(array('bartik', 'seven'));
$theme_settings = $this->container->get('config.factory')->get('system.theme');
foreach (array('bartik', 'stark', 'seven') as $theme) {
foreach (array('bartik', 'classy', 'seven') as $theme) {
$this->drupalGet('admin/structure/block/list/' . $theme);
$this->assertTitle(t('Block layout') . ' | Drupal');
// Select the 'Powered by Drupal' block to be placed.
......@@ -326,7 +326,7 @@ public function testBlockCacheTags() {
$cid = sha1(implode(':', $cid_parts));
$cache_entry = \Drupal::cache('render')->get($cid);
$expected_cache_tags = array(
'theme:stark',
'theme:classy',
'theme_global_settings',
'block_view',
'block:powered',
......@@ -335,11 +335,11 @@ public function testBlockCacheTags() {
);
sort($expected_cache_tags);
$this->assertIdentical($cache_entry->tags, $expected_cache_tags);
$cache_entry = \Drupal::cache('render')->get('entity_view:block:powered:en:stark');
$cache_entry = \Drupal::cache('render')->get('entity_view:block:powered:en:classy');
$expected_cache_tags = array(
'block_view',
'block:powered',
'theme:stark',
'theme:classy',
'block_plugin:system_powered_by_block',
'rendered',
);
......@@ -368,7 +368,7 @@ public function testBlockCacheTags() {
$cid = sha1(implode(':', $cid_parts));
$cache_entry = \Drupal::cache('render')->get($cid);
$expected_cache_tags = array(
'theme:stark',
'theme:classy',
'theme_global_settings',
'block_view',
'block:powered-2',
......@@ -381,22 +381,22 @@ public function testBlockCacheTags() {
$expected_cache_tags = array(
'block_view',
'block:powered',
'theme:stark',
'theme:classy',
'block_plugin:system_powered_by_block',
'rendered',
);
sort($expected_cache_tags);
$cache_entry = \Drupal::cache('render')->get('entity_view:block:powered:en:stark');
$cache_entry = \Drupal::cache('render')->get('entity_view:block:powered:en:classy');
$this->assertIdentical($cache_entry->tags, $expected_cache_tags);
$expected_cache_tags = array(
'block_view',
'block:powered-2',
'theme:stark',
'theme:classy',
'block_plugin:system_powered_by_block',
'rendered',
);
sort($expected_cache_tags);
$cache_entry = \Drupal::cache('render')->get('entity_view:block:powered-2:en:stark');
$cache_entry = \Drupal::cache('render')->get('entity_view:block:powered-2:en:classy');
$this->assertIdentical($cache_entry->tags, $expected_cache_tags);
// The plugin providing the "Powered by Drupal" block is modified; verify a
......@@ -428,7 +428,7 @@ public function testUninstallTheme() {
$this->drupalGet('<front>');
$this->assertText('Powered by Drupal');
$theme_handler->setDefault('stark');
$theme_handler->setDefault('classy');
$theme_handler->uninstall(['seven']);
// Ensure that the block configuration does not exist anymore.
......
......@@ -82,7 +82,7 @@ protected function setUp() {
public function testBlockDemoUiPage() {
$this->drupalPlaceBlock('system_help_block', array('region' => 'help'));
$this->drupalGet('admin/structure/block');
$this->clickLink(t('Demonstrate block regions (@theme)', array('@theme' => 'Stark')));
$this->clickLink(t('Demonstrate block regions (@theme)', array('@theme' => 'Classy')));
$elements = $this->xpath('//div[contains(@class, "region-highlighted")]/div[contains(@class, "block-region") and contains(text(), :title)]', array(':title' => 'Highlighted'));
$this->assertTrue(!empty($elements), 'Block demo regions are shown.');
}
......@@ -134,7 +134,7 @@ public function testCandidateBlockList() {
$arguments = array(
':ul_class' => 'block-list',
':li_class' => 'test-block-instantiation',
':href' => 'admin/structure/block/add/test_block_instantiation/stark',
':href' => 'admin/structure/block/add/test_block_instantiation/classy',
':text' => 'Display message',
);
......@@ -158,7 +158,7 @@ public function testContextAwareBlocks() {
$arguments = array(
':ul_class' => 'block-list',
':li_class' => 'test-context-aware',
':href' => 'admin/structure/block/add/test_context_aware/stark',
':href' => 'admin/structure/block/add/test_context_aware/classy',
':text' => 'Test context-aware block',
);
......@@ -173,7 +173,7 @@ public function testContextAwareBlocks() {
* Tests that the BlockForm populates machine name correctly.
*/
public function testMachineNameSuggestion() {
$url = 'admin/structure/block/add/test_block_instantiation/stark';
$url = 'admin/structure/block/add/test_block_instantiation/classy';
$this->drupalGet($url);
$this->assertFieldByName('id', 'displaymessage', 'Block form uses raw machine name suggestion when no instance already exists.');
$this->drupalPostForm($url, array(), 'Save block');
......@@ -195,16 +195,16 @@ public function testBlockPlacementIndicator() {
// Select the 'Powered by Drupal' block to be placed.
$block = array();
$block['id'] = strtolower($this->randomMachineName());
$block['theme'] = 'stark';
$block['theme'] = 'classy';
$block['region'] = 'content';
// After adding a block, it will indicate which block was just added.
$this->drupalPostForm('admin/structure/block/add/system_powered_by_block', $block, t('Save block'));
$this->assertUrl('admin/structure/block/list/stark?block-placement=' . drupal_html_class($block['id']));
$this->assertUrl('admin/structure/block/list/classy?block-placement=' . drupal_html_class($block['id']));
// Resaving the block page will remove the block indicator.
$this->drupalPostForm(NULL, array(), t('Save blocks'));
$this->assertUrl('admin/structure/block/list/stark');
$this->assertUrl('admin/structure/block/list/classy');
}
}
......@@ -66,7 +66,7 @@ public function testBlockCategory() {
':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-1',
':href' => \Drupal::Url('block.admin_add', array(
'plugin_id' => 'views_block:' . $edit['id'] . '-block_1',
'theme' => 'stark',
'theme' => 'classy',
)),
':text' => $edit['label'],
);
......@@ -105,7 +105,7 @@ public function testBlockCategory() {
':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-2',
':href' => \Drupal::Url('block.admin_add', array(
'plugin_id' => 'views_block:' . $edit['id'] . '-block_2',
'theme' => 'stark',
'theme' => 'classy',
)),
':text' => $edit['label'],
);
......@@ -117,7 +117,7 @@ public function testBlockCategory() {
':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-3',
':href' => \Drupal::Url('block.admin_add', array(
'plugin_id' => 'views_block:' . $edit['id'] . '-block_3',
'theme' => 'stark',
'theme' => 'classy',
)),
':text' => $edit['label'],
);
......
......@@ -13,5 +13,5 @@ dependencies:
module:
- block_test
theme:
- stark
- classy
visibility: { }
......@@ -144,7 +144,7 @@ public function testsBlockContentAddTypes() {
// Install all themes.
\Drupal::service('theme_handler')->install(array('bartik', 'seven'));
$themes = array('bartik', 'seven', 'stark');
$themes = array('bartik', 'seven', 'classy');
$theme_settings = $this->container->get('config.factory')->get('system.theme');
foreach ($themes as $default_theme) {
// Change the default theme.
......@@ -152,7 +152,7 @@ public function testsBlockContentAddTypes() {
\Drupal::service('router.builder')->rebuild();
// For each installed theme, go to its block page and test the redirects.
$themes = array('bartik', 'stark', 'seven');
$themes = array('bartik', 'classy', 'seven');
foreach ($themes as $theme) {
// Test that adding a block from the 'place blocks' form sends you to the
// block configure form.
......
......@@ -6,7 +6,7 @@ dependencies:
theme:
- stark
id: foobargorilla
theme: stark
theme: classy
region: content
weight: null
provider: null
......
......@@ -48,7 +48,7 @@ public function testMenuBlock() {
// Verify a cache hit, but also the presence of the correct cache tags.
$expected_tags = array(
'theme:stark',
'theme:classy',
'theme_global_settings',
'rendered',
'block_view',
......@@ -106,7 +106,7 @@ public function testMenuBlock() {
$this->verifyPageCache($path, 'MISS');
// Verify a cache hit.
$this->verifyPageCache($path, 'HIT', array('rendered', 'theme:stark', 'theme_global_settings'));
$this->verifyPageCache($path, 'HIT', array('rendered', 'theme:classy', 'theme_global_settings'));
}
}
......@@ -36,7 +36,7 @@ protected function testSearchFormBlock() {
// Test availability of the search block in the admin "Place blocks" list.
$this->drupalGet('admin/structure/block');
$this->assertLinkByHref('/admin/structure/block/add/search_form_block/stark', 0,
$this->assertLinkByHref('/admin/structure/block/add/search_form_block/classy', 0,
'Did not find the search block in block candidate list.');
$block = $this->drupalPlaceBlock('search_form_block');
......
......@@ -203,7 +203,7 @@ protected function setUp() {
$this->enableModules($modules);
}
// In order to use theme functions default theme config needs to exist.
\Drupal::config('system.theme')->set('default', 'stark');
\Drupal::config('system.theme')->set('default', 'classy');
// Tests based on this class are entitled to use Drupal's File and
// StreamWrapper APIs.
......
......@@ -65,7 +65,7 @@ function testPageCacheTags() {
'pre_render',
'rendered',
'system_test_cache_tags_page',
'theme:stark',
'theme:classy',
'theme_global_settings',
);
$this->assertIdentical($cache_entry->tags, $expected_tags);
......
......@@ -283,7 +283,7 @@ public function testReferencedEntity() {
$nonempty_entity_listing_path = 'entity_test/list_labels_alphabetically/' . $entity_type;
$render_cache_tags = array('rendered');
$theme_cache_tags = array('theme:stark', 'theme_global_settings');
$theme_cache_tags = array('theme:classy', 'theme_global_settings');
$view_cache_tag = array();
if ($this->entity->getEntityType()->hasHandlerClass('view_builder')) {
......@@ -327,7 +327,7 @@ public function testReferencedEntity() {
$tags = Cache::mergeTags($render_cache_tags, $theme_cache_tags, $referencing_entity_cache_tags);
$this->verifyPageCache($referencing_entity_path, 'HIT', $tags);
// Also verify the existence of an entity render cache entry.
$cid = 'entity_view:entity_test:' . $this->referencing_entity->id() . ':full:stark:r.anonymous:' . date_default_timezone_get();
$cid = 'entity_view:entity_test:' . $this->referencing_entity->id() . ':full:classy:r.anonymous:' . date_default_timezone_get();
$tags = Cache::mergeTags($render_cache_tags, $referencing_entity_cache_tags);
$this->verifyRenderCache($cid, $tags);
......@@ -337,7 +337,7 @@ public function testReferencedEntity() {
$tags = Cache::mergeTags($render_cache_tags, $theme_cache_tags, $non_referencing_entity_cache_tags);
$this->verifyPageCache($non_referencing_entity_path, 'HIT', $tags);
// Also verify the existence of an entity render cache entry.
$cid = 'entity_view:entity_test:' . $this->non_referencing_entity->id() . ':full:stark:r.anonymous:' . date_default_timezone_get();
$cid = 'entity_view:entity_test:' . $this->non_referencing_entity->id() . ':full:classy:r.anonymous:' . date_default_timezone_get();
$tags = Cache::mergeTags($render_cache_tags, $non_referencing_entity_cache_tags);
$this->verifyRenderCache($cid, $tags);
......
......@@ -44,7 +44,7 @@ public function testEntityUri() {
// Also verify the existence of an entity render cache entry, if this entity
// type supports render caching.
if (\Drupal::entityManager()->getDefinition($entity_type)->isRenderCacheable()) {
$cid = 'entity_view:' . $entity_type . ':' . $this->entity->id() . ':' . $view_mode . ':stark:r.anonymous:' . date_default_timezone_get();
$cid = 'entity_view:' . $entity_type . ':' . $this->entity->id() . ':' . $view_mode . ':classy:r.anonymous:' . date_default_timezone_get();
$cache_entry = \Drupal::cache('render')->get($cid);
$expected_cache_tags = Cache::mergeTags($cache_tag, $view_cache_tag, $this->getAdditionalCacheTagsForEntity($this->entity), array($render_cache_tag));
$this->verifyRenderCache($cid, $expected_cache_tags);
......
......@@ -65,7 +65,7 @@ public function testInstaller() {
$edit = array('preprocess_css' => FALSE);
$this->drupalPostForm('admin/config/development/performance', $edit, t('Save configuration'));
$this->drupalGet('<front>');
$this->assertRaw('stark/css/layout.css');
$this->assertRaw('classy/css/layout.css');
}
}
......@@ -247,7 +247,6 @@ public function testThemeIntegration() {
->set('default', $this->default_theme)
->set('admin', $this->admin_theme)
->save();
$theme_handler->uninstall(array('stark'));
$this->doTestThemeCallbackMaintenanceMode();
......
......@@ -48,7 +48,7 @@ function testThemeSettings() {
// Specify a filesystem path to be used for the logo.
$file = current($this->drupalGetTestFiles('image'));
$file_relative = strtr($file->uri, array('public:/' => PublicStream::basePath()));
$default_theme_path = 'core/themes/stark';
$default_theme_path = 'core/themes/classy';
$supported_paths = array(
// Raw stream wrapper URI.
......@@ -192,7 +192,7 @@ function testAdministrationTheme() {
$this->assertRaw('core/themes/seven', 'Administration theme used on an administration page.');
$this->drupalGet('node/' . $this->node->id());
$this->assertRaw('core/themes/stark', 'Site default theme used on node page.');
$this->assertRaw('core/themes/classy', 'Site default theme used on node page.');
$this->drupalGet('node/add');
$this->assertRaw('core/themes/seven', 'Administration theme used on the add content page.');
......@@ -218,7 +218,7 @@ function testAdministrationTheme() {
$this->drupalLogin($this->admin_user);
$this->drupalGet('node/add');
$this->assertRaw('core/themes/stark', 'Site default theme used on the add content page.');
$this->assertRaw('core/themes/classy', 'Site default theme used on the add content page.');
// Reset to the default theme settings.
$edit = array(
......@@ -228,10 +228,10 @@ function testAdministrationTheme() {
$this->drupalPostForm('admin/appearance', $edit, t('Save configuration'));
$this->drupalGet('admin');
$this->assertRaw('core/themes/stark', 'Site default theme used on administration page.');
$this->assertRaw('core/themes/classy', 'Site default theme used on administration page.');
$this->drupalGet('node/add');
$this->assertRaw('core/themes/stark', 'Site default theme used on the add content page.');
$this->assertRaw('core/themes/classy', 'Site default theme used on the add content page.');
}
/**
......@@ -249,10 +249,10 @@ function testSwitchDefaultTheme() {
$this->assertText('Bartik(' . t('active tab') . ')', 'Default local task on blocks admin page is the default theme.');
// Switch back to Stark and test again to test that the menu cache is cleared.
$this->drupalGet('admin/appearance');
// Stark is the second 'Set as default' link.
$this->clickLink(t('Set as default'), 1);
// Classy is the first 'Set as default' link.
$this->clickLink(t('Set as default'), 0);
$this->drupalGet('admin/structure/block');
$this->assertText('Stark(' . t('active tab') . ')', 'Default local task on blocks admin page has changed.');
$this->assertText('Classy(' . t('active tab') . ')', 'Default local task on blocks admin page has changed.');
}
/**
......
......@@ -33,6 +33,6 @@ function testRequestListener() {
$this->assertRaw('Themed output generated in a KernelEvents::REQUEST listener');
// Verify that the default theme's CSS still appears even though the theme
// system was initialized early.
$this->assertRaw('stark/css/layout.css');
$this->assertRaw('classy/css/layout.css');
}
}
......@@ -26,7 +26,7 @@ public function applies(RouteMatchInterface $route_match) {
* {@inheritdoc}
*/
public function determineActiveTheme(RouteMatchInterface $route_match) {
return 'stark';
return 'classy';
}
}
......@@ -12,6 +12,7 @@ name: 'Test theme'
type: theme
description: 'Theme for testing the theme system'
version: VERSION
base theme: classy
core: 8.x
stylesheets-remove:
- system.module.css
......
......@@ -49,7 +49,7 @@ public function testRenderedTour() {
// Verify a cache hit, but also the presence of the correct cache tags.
$expected_tags = array(
'theme:stark',
'theme:classy',
'theme_global_settings',
'tour:tour-test',
'rendered',
......@@ -70,7 +70,7 @@ public function testRenderedTour() {
$this->verifyPageCache($path, 'MISS');
// Verify a cache hit.
$this->verifyPageCache($path, 'HIT', array('rendered', 'theme:stark', 'theme_global_settings'));
$this->verifyPageCache($path, 'HIT', array('rendered', 'theme:classy', 'theme_global_settings'));
}
}
# @todo: Remove this file in https://www.drupal.org/node/2352949
default: classy
......@@ -4,3 +4,6 @@ description: 'Minimal profile for running tests. Includes absolutely required mo
version: VERSION
core: 8.x
hidden: true
# @todo: Remove this in https://www.drupal.org/node/2352949
themes:
- classy
......@@ -4,3 +4,7 @@ description: 'A base theme with sensible default CSS classes added. Learn how to
package: Core
version: VERSION
core: 8.x
stylesheets:
all:
- css/layout.css
/**
* @file
* Classy layout file. Do NOT delete. Needed for testing.
*
* @see \Drupal\system\Tests\Installer\InstallerTranslationTest::testInstaller()
*/
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