Issue #3304731 by phenaproxima, bnjmnm: Update remaining tests using Classy to use Starterkit
parent
e1d4f00419
commit
4024e3c478
|
@ -30,7 +30,7 @@ class FormErrorHandlerCKEditorTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -27,7 +27,7 @@ class MediaLibraryTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* The user to use during testing.
|
||||
|
@ -306,21 +306,20 @@ class MediaLibraryTest extends WebDriverTestBase {
|
|||
$this->assertNotEmpty($assert_session->waitForId('media-library-wrapper'));
|
||||
|
||||
if (empty($allowed_media_types) || count($allowed_media_types) === 2) {
|
||||
$assert_session->elementExists('css', 'li.media-library-menu-image');
|
||||
$assert_session->elementExists('css', 'li.media-library-menu-arrakis');
|
||||
$assert_session->elementTextContains('css', '.media-library-item__name', 'Fear is the mind-killer');
|
||||
$menu = $assert_session->elementExists('css', '.js-media-library-menu');
|
||||
$assert_session->elementExists('named', ['link', 'Image'], $menu);
|
||||
$assert_session->elementExists('named', ['link', 'Arrakis'], $menu);
|
||||
$assert_session->elementTextContains('css', '.js-media-library-item', 'Fear is the mind-killer');
|
||||
}
|
||||
elseif (count($allowed_media_types) === 1 && !empty($allowed_media_types['image'])) {
|
||||
// No tabs should appear if there's only one media type available.
|
||||
$assert_session->elementNotExists('css', 'li.media-library-menu-image');
|
||||
$assert_session->elementNotExists('css', 'li.media-library-menu-arrakis');
|
||||
$assert_session->elementTextContains('css', '.media-library-item__name', 'Fear is the mind-killer');
|
||||
$assert_session->elementNotExists('css', '.js-media-library-menu');
|
||||
$assert_session->elementTextContains('css', '.js-media-library-item', 'Fear is the mind-killer');
|
||||
}
|
||||
elseif (count($allowed_media_types) === 1 && !empty($allowed_media_types['arrakis'])) {
|
||||
// No tabs should appear if there's only one media type available.
|
||||
$assert_session->elementNotExists('css', 'li.media-library-menu-image');
|
||||
$assert_session->elementNotExists('css', 'li.media-library-menu-arrakis');
|
||||
$assert_session->elementTextContains('css', '.media-library-item__name', 'Le baron Vladimir Harkonnen');
|
||||
$assert_session->elementNotExists('css', '.js-media-library-menu');
|
||||
$assert_session->elementTextContains('css', '.js-media-library-item', 'Le baron Vladimir Harkonnen');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ class MediaTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -242,18 +242,18 @@ class MediaTest extends WebDriverTestBase {
|
|||
$this->getSession()->switchToIFrame('ckeditor');
|
||||
$this->assertNotEmpty($assert_session->waitForElement('css', 'drupal-media figure.caption-drupal-media .this-error-message-is-themeable'));
|
||||
|
||||
// Test when using the classy theme, an additional class is added in
|
||||
// classy/templates/content/media-embed-error.html.twig.
|
||||
$this->assertTrue($this->container->get('theme_installer')->install(['classy']));
|
||||
// Test when using the starterkit_theme theme, an additional class is added
|
||||
// to the error, which is supported by
|
||||
// stable9/templates/content/media-embed-error.html.twig.
|
||||
$this->assertTrue($this->container->get('theme_installer')->install(['starterkit_theme']));
|
||||
$this->config('system.theme')
|
||||
->set('default', 'classy')
|
||||
->set('default', 'starterkit_theme')
|
||||
->save();
|
||||
$this->drupalGet($this->host->toUrl('edit-form'));
|
||||
$this->waitForEditor();
|
||||
$this->assignNameToCkeditorIframe();
|
||||
$this->getSession()->switchToIFrame('ckeditor');
|
||||
$this->assertNotEmpty($assert_session->waitForElement('css', 'drupal-media figure.caption-drupal-media .this-error-message-is-themeable.media-embed-error--missing-source'));
|
||||
$assert_session->responseContains('classy/css/components/media-embed-error.css');
|
||||
$this->assertNotEmpty($assert_session->waitForElement('css', 'drupal-media figure.caption-drupal-media .this-error-message-is-themeable'));
|
||||
|
||||
// Test that restoring a valid UUID results in the media embed preview
|
||||
// displaying.
|
||||
|
@ -282,8 +282,8 @@ class MediaTest extends WebDriverTestBase {
|
|||
|
||||
// Configure a different default and admin theme, like on most Drupal sites.
|
||||
$this->config('system.theme')
|
||||
->set('default', 'stable')
|
||||
->set('admin', 'classy')
|
||||
->set('default', 'stable9')
|
||||
->set('admin', 'starterkit_theme')
|
||||
->save();
|
||||
|
||||
// Assert that when looking at an embedded entity in the CKEditor Widget,
|
||||
|
@ -296,7 +296,7 @@ class MediaTest extends WebDriverTestBase {
|
|||
$assert_session = $this->assertSession();
|
||||
$this->assertNotEmpty($assert_session->waitForElementVisible('css', 'img[src*="image-test.png"]'));
|
||||
$element = $assert_session->elementExists('css', '[data-media-embed-test-active-theme]');
|
||||
$this->assertSame('stable', $element->getAttribute('data-media-embed-test-active-theme'));
|
||||
$this->assertSame('stable9', $element->getAttribute('data-media-embed-test-active-theme'));
|
||||
// Assert that the first preview request transferred >500 B over the wire.
|
||||
// Then toggle source mode on and off. This causes the CKEditor widget to be
|
||||
// destroyed and then reconstructed. Assert that during this reconstruction,
|
||||
|
@ -1069,7 +1069,7 @@ class MediaTest extends WebDriverTestBase {
|
|||
$this->assignNameToCkeditorIframe();
|
||||
$this->getSession()->switchToIFrame('ckeditor');
|
||||
if ($media_embed_enabled) {
|
||||
// The preview rendering, which in this test will use Classy's
|
||||
// The preview rendering, which in this test will use Starterkit's
|
||||
// media.html.twig template, will fail without the CSRF token/header.
|
||||
// @see ::testEmbeddedMediaPreviewWithCsrfToken()
|
||||
$this->assertNotEmpty($assert_session->waitForElementVisible('css', 'article.media'));
|
||||
|
|
|
@ -27,7 +27,7 @@ class MediaLibraryTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* The user to use during testing.
|
||||
|
@ -246,21 +246,20 @@ class MediaLibraryTest extends WebDriverTestBase {
|
|||
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-modal #media-library-wrapper'));
|
||||
|
||||
if (empty($allowed_media_types) || count($allowed_media_types) === 2) {
|
||||
$assert_session->elementExists('css', 'li.media-library-menu-image');
|
||||
$assert_session->elementExists('css', 'li.media-library-menu-arrakis');
|
||||
$assert_session->elementTextContains('css', '.media-library-item__name', 'Fear is the mind-killer');
|
||||
$menu = $assert_session->elementExists('css', '.js-media-library-menu');
|
||||
$assert_session->elementExists('named', ['link', 'Image'], $menu);
|
||||
$assert_session->elementExists('named', ['link', 'Arrakis'], $menu);
|
||||
$assert_session->elementTextContains('css', '.js-media-library-item', 'Fear is the mind-killer');
|
||||
}
|
||||
elseif (count($allowed_media_types) === 1 && !empty($allowed_media_types['image'])) {
|
||||
// No tabs should appear if there's only one media type available.
|
||||
$assert_session->elementNotExists('css', 'li.media-library-menu-image');
|
||||
$assert_session->elementNotExists('css', 'li.media-library-menu-arrakis');
|
||||
$assert_session->elementTextContains('css', '.media-library-item__name', 'Fear is the mind-killer');
|
||||
$assert_session->elementNotExists('css', '.js-media-library-menu');
|
||||
$assert_session->elementTextContains('css', '.js-media-library-item', 'Fear is the mind-killer');
|
||||
}
|
||||
elseif (count($allowed_media_types) === 1 && !empty($allowed_media_types['arrakis'])) {
|
||||
// No tabs should appear if there's only one media type available.
|
||||
$assert_session->elementNotExists('css', 'li.media-library-menu-image');
|
||||
$assert_session->elementNotExists('css', 'li.media-library-menu-arrakis');
|
||||
$assert_session->elementTextContains('css', '.media-library-item__name', 'Le baron Vladimir Harkonnen');
|
||||
$assert_session->elementNotExists('css', '.js-media-library-menu');
|
||||
$assert_session->elementTextContains('css', '.js-media-library-item', 'Le baron Vladimir Harkonnen');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ class MediaTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -438,18 +438,16 @@ class MediaTest extends WebDriverTestBase {
|
|||
$this->waitForEditor();
|
||||
$this->assertNotEmpty($assert_session->waitForElement('css', '.ck-widget.drupal-media .this-error-message-is-themeable'));
|
||||
|
||||
// Test when using the classy theme, an additional class is added in
|
||||
// classy/templates/content/media-embed-error.html.twig.
|
||||
$this->assertTrue($this->container->get('theme_installer')->install(['classy']));
|
||||
// Test when using the starterkit_theme theme, an additional class is added
|
||||
// to the error, which is supported by
|
||||
// stable9/templates/content/media-embed-error.html.twig.
|
||||
$this->assertTrue($this->container->get('theme_installer')->install(['starterkit_theme']));
|
||||
$this->config('system.theme')
|
||||
->set('default', 'classy')
|
||||
->set('default', 'starterkit_theme')
|
||||
->save();
|
||||
$this->drupalGet($this->host->toUrl('edit-form'));
|
||||
$this->waitForEditor();
|
||||
$this->assertNotEmpty($assert_session->waitForElement('css', '.ck-widget.drupal-media .this-error-message-is-themeable.media-embed-error--missing-source'));
|
||||
// @todo Uncomment this in https://www.drupal.org/project/ckeditor5/issues/3194084.
|
||||
// @codingStandardsIgnoreLine
|
||||
//$assert_session->responseContains('classy/css/components/media-embed-error.css');
|
||||
$this->assertNotEmpty($assert_session->waitForElement('css', '.ck-widget.drupal-media .this-error-message-is-themeable'));
|
||||
|
||||
// Test that restoring a valid UUID results in the media embed preview
|
||||
// displaying.
|
||||
|
@ -476,8 +474,8 @@ class MediaTest extends WebDriverTestBase {
|
|||
|
||||
// Configure a different default and admin theme, like on most Drupal sites.
|
||||
$this->config('system.theme')
|
||||
->set('default', 'stable')
|
||||
->set('admin', 'classy')
|
||||
->set('default', 'stable9')
|
||||
->set('admin', 'starterkit_theme')
|
||||
->save();
|
||||
|
||||
// Assert that when looking at an embedded entity in the CKEditor Widget,
|
||||
|
@ -488,7 +486,7 @@ class MediaTest extends WebDriverTestBase {
|
|||
$assert_session = $this->assertSession();
|
||||
$this->assertNotEmpty($assert_session->waitForElementVisible('css', 'img[src*="image-test.png"]'));
|
||||
$element = $assert_session->elementExists('css', '[data-media-embed-test-active-theme]');
|
||||
$this->assertSame('stable', $element->getAttribute('data-media-embed-test-active-theme'));
|
||||
$this->assertSame('stable9', $element->getAttribute('data-media-embed-test-active-theme'));
|
||||
// Assert that the first preview request transferred >500 B over the wire.
|
||||
// Then toggle source mode on and off. This causes the CKEditor widget to be
|
||||
// destroyed and then reconstructed. Assert that during this reconstruction,
|
||||
|
@ -1092,7 +1090,7 @@ class MediaTest extends WebDriverTestBase {
|
|||
if ($can_use_format) {
|
||||
$this->waitForEditor();
|
||||
if ($media_embed_enabled) {
|
||||
// The preview rendering, which in this test will use Classy's
|
||||
// The preview rendering, which in this test will use Starterkit theme's
|
||||
// media.html.twig template, will fail without the CSRF token/header.
|
||||
// @see ::testEmbeddedMediaPreviewWithCsrfToken()
|
||||
$this->assertNotEmpty($assert_session->waitForElementVisible('css', 'article.media'));
|
||||
|
|
|
@ -21,13 +21,8 @@ class CommentCSSTest extends CommentTestBase {
|
|||
* The theme to install as the default for testing.
|
||||
*
|
||||
* @var string
|
||||
*
|
||||
* @todo This test's reliance on classes makes Stark a bad fit as a base
|
||||
* theme. Change the default theme to Starterkit once it is stable.
|
||||
*
|
||||
* @see https://www.drupal.org/project/drupal/issues/3267890
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
|
|
@ -39,7 +39,7 @@ class ForumTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* A user with various administrative privileges.
|
||||
|
@ -202,27 +202,24 @@ class ForumTest extends BrowserTestBase {
|
|||
// Verify the topic and post counts on the forum page.
|
||||
$this->drupalGet('forum');
|
||||
|
||||
// Verify row for testing forum.
|
||||
$forum_arg = [':forum' => 'forum-list-' . $this->forum['tid']];
|
||||
// Find the table row for the forum that has new posts. This cannot be
|
||||
// reliably identified by any CSS selector or its position in the table,
|
||||
// so look for an element with the "New posts" title and traverse up the
|
||||
// document tree until we get to the table row that contains it.
|
||||
$row = $this->assertSession()->elementExists('css', '[title="New posts"]');
|
||||
while ($row && $row->getTagName() !== 'tr') {
|
||||
$row = $row->getParent();
|
||||
}
|
||||
$this->assertNotEmpty($row);
|
||||
$cells = $row->findAll('css', 'td');
|
||||
$this->assertCount(4, $cells);
|
||||
|
||||
// Topics cell contains number of topics and number of unread topics.
|
||||
$xpath = $this->assertSession()->buildXPathQuery('//tr[@id=:forum]//td[@class="forum__topics"]', $forum_arg);
|
||||
$topics = $this->xpath($xpath);
|
||||
$topics = trim($topics[0]->getText());
|
||||
// The extracted text contains the number of topics (6) and new posts
|
||||
// (also 6) in this table cell.
|
||||
$this->assertEquals('6 6 new posts in forum ' . $this->forum['name'], $topics, 'Number of topics found.');
|
||||
|
||||
// Verify the number of unread topics.
|
||||
$elements = $this->xpath('//tr[@id=:forum]//td[@class="forum__topics"]//a', $forum_arg);
|
||||
$this->assertStringStartsWith('6 new posts', $elements[0]->getText(), 'Number of unread topics found.');
|
||||
// Verify that the forum name is in the unread topics text.
|
||||
$elements = $this->xpath('//tr[@id=:forum]//em[@class="placeholder"]', $forum_arg);
|
||||
$this->assertStringContainsString($this->forum['name'], $elements[0]->getText(), 'Forum name found in unread topics text.');
|
||||
// Topics cell contains number of topics (6), number of unread topics (also
|
||||
// 6), and the forum name.
|
||||
$this->assertEquals('6 6 new posts in forum ' . $this->forum['name'], $cells[1]->getText(), 'Number of topics found.');
|
||||
|
||||
// Verify total number of posts in forum.
|
||||
$elements = $this->xpath('//tr[@id=:forum]//td[@class="forum__posts"]', $forum_arg);
|
||||
$this->assertEquals('6', $elements[0]->getText(), 'Number of posts found.');
|
||||
$this->assertEquals('6', $cells[2]->getText(), 'Number of posts found.');
|
||||
|
||||
// Test loading multiple forum nodes on the front page.
|
||||
$this->drupalLogin($this->drupalCreateUser([
|
||||
|
|
|
@ -33,14 +33,8 @@ class LanguageSwitchingTest extends BrowserTestBase {
|
|||
* The theme to install as the default for testing.
|
||||
*
|
||||
* @var string
|
||||
*
|
||||
* @todo This test's focus on classes in ::doTestLanguageBlockAuthenticated()
|
||||
* and ::testLanguageBodyClass() make Stark a bad fit as a base theme.
|
||||
* Change the default theme to Starterkit once it is stable.
|
||||
*
|
||||
* @see https://www.drupal.org/project/drupal/issues/3275543
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
@ -104,10 +98,8 @@ class LanguageSwitchingTest extends BrowserTestBase {
|
|||
$anchors = [];
|
||||
$labels = [];
|
||||
foreach ($language_switchers as $list_item) {
|
||||
$classes = explode(" ", $list_item->getAttribute('class'));
|
||||
[$langcode] = array_intersect($classes, ['en', 'fr']);
|
||||
$list_items[] = [
|
||||
'langcode_class' => $langcode,
|
||||
'hreflang' => $list_item->getAttribute('hreflang'),
|
||||
'data-drupal-link-system-path' => $list_item->getAttribute('data-drupal-link-system-path'),
|
||||
];
|
||||
|
||||
|
@ -119,8 +111,8 @@ class LanguageSwitchingTest extends BrowserTestBase {
|
|||
$labels[] = $link->getText();
|
||||
}
|
||||
$expected_list_items = [
|
||||
0 => ['langcode_class' => 'en', 'data-drupal-link-system-path' => 'user/2'],
|
||||
1 => ['langcode_class' => 'fr', 'data-drupal-link-system-path' => 'user/2'],
|
||||
0 => ['hreflang' => 'en', 'data-drupal-link-system-path' => 'user/2'],
|
||||
1 => ['hreflang' => 'fr', 'data-drupal-link-system-path' => 'user/2'],
|
||||
];
|
||||
$this->assertSame($expected_list_items, $list_items, 'The list items have the correct attributes that will allow the drupal.active-link library to mark them as active.');
|
||||
$expected_anchors = [
|
||||
|
@ -163,9 +155,8 @@ class LanguageSwitchingTest extends BrowserTestBase {
|
|||
];
|
||||
$labels = [];
|
||||
foreach ($language_switchers as $list_item) {
|
||||
$classes = explode(" ", $list_item->getAttribute('class'));
|
||||
[$langcode] = array_intersect($classes, ['en', 'fr']);
|
||||
if (in_array('is-active', $classes)) {
|
||||
$langcode = $list_item->getAttribute('hreflang');
|
||||
if ($list_item->hasClass('is-active')) {
|
||||
$links['active'][] = $langcode;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -26,7 +26,7 @@ class LayoutBuilderAccessTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -34,7 +34,7 @@ class LayoutBuilderTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -24,7 +24,7 @@ class LayoutBuilderThemeSuggestionsTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -28,7 +28,7 @@ class LayoutSectionTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -31,7 +31,7 @@ class AjaxBlockTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -28,7 +28,7 @@ class BlockFormMessagesTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -31,7 +31,7 @@ class ContentPreviewToggleTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -32,7 +32,7 @@ class ContextualLinksTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -30,7 +30,7 @@ class FieldBlockTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -81,7 +81,7 @@ class FieldBlockTest extends WebDriverTestBase {
|
|||
$assert_session->pageTextNotContains('Initial email');
|
||||
|
||||
$assert_session->pageTextContains('Date field');
|
||||
$block_url = 'admin/structure/block/add/field_block_test%3Auser%3Auser%3Afield_date/classy';
|
||||
$block_url = 'admin/structure/block/add/field_block_test%3Auser%3Auser%3Afield_date/starterkit_theme';
|
||||
$assert_session->linkByHrefExists($block_url);
|
||||
|
||||
$this->drupalGet($block_url);
|
||||
|
@ -152,7 +152,7 @@ class FieldBlockTest extends WebDriverTestBase {
|
|||
]);
|
||||
$timestamp_field->save();
|
||||
|
||||
$this->drupalGet('admin/structure/block/add/field_block_test%3Auser%3Auser%3Afield_timestamp/classy');
|
||||
$this->drupalGet('admin/structure/block/add/field_block_test%3Auser%3Auser%3Afield_timestamp/starterkit_theme');
|
||||
$this->assertFalse($page->findField('settings[formatter][settings][custom_date_format]')->isVisible(), 'Custom date format is not visible');
|
||||
$page->selectFieldOption('settings[formatter][settings][date_format]', 'custom');
|
||||
$this->assertTrue($page->findField('settings[formatter][settings][custom_date_format]')->isVisible(), 'Custom date format is visible');
|
||||
|
|
|
@ -30,7 +30,7 @@ class InlineBlockPrivateFilesTest extends InlineBlockTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* The file system service.
|
||||
|
|
|
@ -15,7 +15,7 @@ class InlineBlockTest extends InlineBlockTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -40,7 +40,7 @@ class LayoutBuilderDisableInteractionsTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -23,7 +23,7 @@ class LayoutBuilderOptInTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -35,7 +35,7 @@ class LayoutBuilderTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* The node to customize with Layout Builder.
|
||||
|
|
|
@ -26,7 +26,7 @@ class LayoutBuilderToolbarTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -38,7 +38,7 @@ class LayoutBuilderUiTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -28,7 +28,7 @@ class MoveBlockFormTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -46,8 +46,8 @@ abstract class LayoutBuilderCompatibilityTestBase extends EntityKernelTestBase {
|
|||
// Set up a non-admin user that is allowed to view test entities.
|
||||
\Drupal::currentUser()->setAccount($this->createUser(['uid' => 2], ['view test entity']));
|
||||
|
||||
\Drupal::service('theme_installer')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
\Drupal::service('theme_installer')->install(['starterkit_theme']);
|
||||
$this->config('system.theme')->set('default', 'starterkit_theme')->save();
|
||||
|
||||
$field_storage = FieldStorageConfig::create([
|
||||
'entity_type' => 'entity_test_base_field_display',
|
||||
|
|
|
@ -23,14 +23,8 @@ class EntityReferenceWidgetTest extends MediaLibraryTestBase {
|
|||
* The theme to install as the default for testing.
|
||||
*
|
||||
* @var string
|
||||
*
|
||||
* @todo This test's reliance on classes in order to assert the order of
|
||||
* field items makes Stark a bad fit as a base theme. Change the default
|
||||
* theme to Starterkit once it is stable.
|
||||
*
|
||||
* @see https://www.drupal.org/project/drupal/issues/3281695
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Test media items.
|
||||
|
|
|
@ -48,15 +48,8 @@ class PagePreviewTest extends NodeTestBase {
|
|||
* The theme to install as the default for testing.
|
||||
*
|
||||
* @var string
|
||||
*
|
||||
* @todo The fact that PagePreviewTest::testPagePreview() makes assertions
|
||||
* related to the node type being used for a body class makes Stark a bad
|
||||
* fit as a base theme. Change the default theme to Starterkit once it is
|
||||
* stable.
|
||||
*
|
||||
* @see https://www.drupal.org/project/drupal/issues/3274077
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* The name of the created field.
|
||||
|
|
|
@ -167,9 +167,6 @@ class NodeDisplayConfigurableTest extends NodeTestBase {
|
|||
public function provideThemes() {
|
||||
return [
|
||||
['claro', 'footer', TRUE],
|
||||
// @todo Remove Classy from data provider in
|
||||
// https://www.drupal.org/project/drupal/issues/3110137.
|
||||
['classy', 'footer', TRUE],
|
||||
// @todo Add coverage for olivero after fixing
|
||||
// https://www.drupal.org/project/drupal/issues/3215220.
|
||||
// ['olivero', 'footer', TRUE],
|
||||
|
|
|
@ -24,7 +24,7 @@ class StandardProfileTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* The profile used during tests.
|
||||
|
|
|
@ -30,8 +30,8 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
* Tests the integer formatter with settings.
|
||||
*/
|
||||
public function testIntegerFormatterWithSettings() {
|
||||
\Drupal::service('theme_installer')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
\Drupal::service('theme_installer')->install(['starterkit_theme']);
|
||||
$this->config('system.theme')->set('default', 'starterkit_theme')->save();
|
||||
$this->fieldType = 'integer';
|
||||
$formatter = [
|
||||
'type' => 'number_integer',
|
||||
|
@ -73,8 +73,8 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
* Tests the float formatter with settings.
|
||||
*/
|
||||
public function testFloatFormatterWithSettings() {
|
||||
\Drupal::service('theme_installer')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
\Drupal::service('theme_installer')->install(['starterkit_theme']);
|
||||
$this->config('system.theme')->set('default', 'starterkit_theme')->save();
|
||||
$this->fieldType = 'float';
|
||||
$formatter = [
|
||||
'type' => 'number_decimal',
|
||||
|
@ -123,8 +123,8 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
* Tests the float formatter with a scale. Scale is exercised.
|
||||
*/
|
||||
public function testFloatFormatterWithScaleExercised() {
|
||||
\Drupal::service('theme_installer')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
\Drupal::service('theme_installer')->install(['starterkit_theme']);
|
||||
$this->config('system.theme')->set('default', 'starterkit_theme')->save();
|
||||
$this->fieldType = 'float';
|
||||
$formatter = [
|
||||
'type' => 'number_decimal',
|
||||
|
@ -161,8 +161,8 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
* Tests the decimal formatter with settings.
|
||||
*/
|
||||
public function testDecimalFormatterWithSettings() {
|
||||
\Drupal::service('theme_installer')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
\Drupal::service('theme_installer')->install(['starterkit_theme']);
|
||||
$this->config('system.theme')->set('default', 'starterkit_theme')->save();
|
||||
$this->fieldType = 'decimal';
|
||||
$formatter = [
|
||||
'type' => 'number_decimal',
|
||||
|
|
|
@ -21,7 +21,7 @@ class HighPriorityThemeNegotiator implements ThemeNegotiatorInterface {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function determineActiveTheme(RouteMatchInterface $route_match) {
|
||||
return 'classy';
|
||||
return 'starterkit_theme';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* Test module.
|
||||
*/
|
||||
|
||||
use Drupal\Component\Utility\NestedArray;
|
||||
use Drupal\Core\Extension\Extension;
|
||||
|
||||
/**
|
||||
|
@ -172,3 +173,18 @@ function theme_test_theme_suggestions_node(array $variables) {
|
|||
*/
|
||||
function template_preprocess_theme_test_registered_by_module() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_library_info_alter().
|
||||
*/
|
||||
function theme_test_library_info_alter(array &$libraries, string $extension): void {
|
||||
// Allow test code to simulate library changes in a particular extension by
|
||||
// setting a state key in the form `theme_test_library_info_alter $extension`,
|
||||
// whose values is an array containing everything that should be recursively
|
||||
// merged into the given extension's library definitions.
|
||||
$info = \Drupal::state()->get(__FUNCTION__ . " $extension");
|
||||
|
||||
if (is_array($info)) {
|
||||
$libraries = NestedArray::mergeDeep($libraries, $info);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class ProcessingTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Tests batches triggered outside of form submission.
|
||||
|
|
|
@ -22,7 +22,7 @@ class EntityViewControllerTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Array of test entities.
|
||||
|
|
|
@ -22,7 +22,7 @@ class ElementTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Tests placeholder text for elements that support placeholders.
|
||||
|
|
|
@ -31,7 +31,7 @@ class FormTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
|
|
@ -28,7 +28,7 @@ class BreadcrumbFrontCacheContextsTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* A test node with path alias.
|
||||
|
|
|
@ -23,7 +23,7 @@ class LocalTasksTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* The local tasks block under testing.
|
||||
|
|
|
@ -24,7 +24,7 @@ class PageTitleTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
protected $contentUser;
|
||||
protected $savedTitle;
|
||||
|
|
|
@ -37,7 +37,7 @@ class ThemeTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* A test node.
|
||||
|
@ -81,7 +81,7 @@ class ThemeTest extends BrowserTestBase {
|
|||
// Specify a filesystem path to be used for the logo.
|
||||
$file = current($this->drupalGetTestFiles('image'));
|
||||
$file_relative = strtr($file->uri, ['public:/' => PublicStream::basePath()]);
|
||||
$default_theme_path = 'core/themes/classy';
|
||||
$default_theme_path = 'core/themes/starterkit_theme';
|
||||
|
||||
/** @var \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator */
|
||||
$file_url_generator = \Drupal::service('file_url_generator');
|
||||
|
@ -208,7 +208,7 @@ class ThemeTest extends BrowserTestBase {
|
|||
$this->drupalPlaceBlock('local_tasks_block', ['region' => 'header']);
|
||||
$this->drupalGet('admin/appearance/settings');
|
||||
$theme_handler = \Drupal::service('theme_handler');
|
||||
$this->assertSession()->linkExists($theme_handler->getName('classy'));
|
||||
$this->assertSession()->linkExists($theme_handler->getName('starterkit_theme'));
|
||||
$this->assertSession()->linkExists($theme_handler->getName('olivero'));
|
||||
$this->assertSession()->linkNotExists($theme_handler->getName('stable'));
|
||||
|
||||
|
@ -311,7 +311,7 @@ class ThemeTest extends BrowserTestBase {
|
|||
|
||||
// Check that the site default theme used on node page.
|
||||
$this->drupalGet('node/' . $this->node->id());
|
||||
$this->assertSession()->responseContains('core/themes/classy');
|
||||
$this->assertSession()->responseContains('core/themes/starterkit_theme');
|
||||
|
||||
// Check that the administration theme is used on the add content page.
|
||||
$this->drupalGet('node/add');
|
||||
|
@ -347,7 +347,7 @@ class ThemeTest extends BrowserTestBase {
|
|||
|
||||
// Check that the site default theme used on the add content page.
|
||||
$this->drupalGet('node/add');
|
||||
$this->assertSession()->responseContains('core/themes/classy');
|
||||
$this->assertSession()->responseContains('core/themes/starterkit_theme');
|
||||
|
||||
// Reset to the default theme settings.
|
||||
$edit = [
|
||||
|
@ -359,11 +359,11 @@ class ThemeTest extends BrowserTestBase {
|
|||
|
||||
// Check that the site default theme used on administration page.
|
||||
$this->drupalGet('admin');
|
||||
$this->assertSession()->responseContains('core/themes/classy');
|
||||
$this->assertSession()->responseContains('core/themes/starterkit_theme');
|
||||
|
||||
// Check that the site default theme used on the add content page.
|
||||
$this->drupalGet('node/add');
|
||||
$this->assertSession()->responseContains('core/themes/classy');
|
||||
$this->assertSession()->responseContains('core/themes/starterkit_theme');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,7 +22,7 @@ class ThemeEarlyInitializationTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Tests that the theme system can generate output in a request listener.
|
||||
|
@ -33,7 +33,7 @@ class ThemeEarlyInitializationTest extends BrowserTestBase {
|
|||
$this->assertSession()->responseContains('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->assertSession()->responseContains('classy/css/components/action-links.css');
|
||||
$this->assertSession()->responseContains('starterkit_theme/css/components/action-links.css');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -95,13 +95,13 @@ class ThemeInfoTest extends BrowserTestBase {
|
|||
$active_theme = $this->themeManager->getActiveTheme();
|
||||
// Make sure we are not testing the wrong theme.
|
||||
$this->assertEquals('test_theme', $active_theme->getName());
|
||||
$this->assertEquals(['classy/base', 'classy/messages', 'core/normalize', 'test_theme/global-styling'], $active_theme->getLibraries());
|
||||
$this->assertEquals(['starterkit_theme/base', 'starterkit_theme/messages', 'core/normalize', 'test_theme/global-styling'], $active_theme->getLibraries());
|
||||
|
||||
// @see theme_test_system_info_alter()
|
||||
$this->state->set('theme_test.modify_info_files', TRUE);
|
||||
$this->resetAll();
|
||||
$active_theme = $this->themeManager->getActiveTheme();
|
||||
$this->assertEquals(['classy/base', 'classy/messages', 'core/normalize', 'test_theme/global-styling', 'core/once'], $active_theme->getLibraries());
|
||||
$this->assertEquals(['starterkit_theme/base', 'starterkit_theme/messages', 'core/normalize', 'test_theme/global-styling', 'core/once'], $active_theme->getLibraries());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ class ThemeTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -51,7 +51,7 @@ class ThemeTokenTest extends BrowserTestBase {
|
|||
$this->config('system.theme')->set('admin', 'claro')->save();
|
||||
|
||||
// Revisit the page. This time the page is displayed using the 'claro' theme
|
||||
// and that is different from the default theme ('classy').
|
||||
// and that is different from the default theme ('stark').
|
||||
$this->drupalGet('admin/structure/block');
|
||||
$settings = $this->getDrupalSettings();
|
||||
$this->assertNotNull($settings['ajaxPageState']['theme_token']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class ThemeUpdateTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Ensures preprocess functions run even for suggestion implementations.
|
||||
|
|
|
@ -20,7 +20,7 @@ class FrameworkTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Tests that new JavaScript and CSS files are lazy-loaded on an AJAX request.
|
||||
|
|
|
@ -109,7 +109,7 @@ abstract class OffCanvasTestBase extends WebDriverTestBase {
|
|||
* Theme names to test.
|
||||
*/
|
||||
protected function getTestThemes() {
|
||||
return ['claro', 'classy', 'olivero', 'stable', 'stark'];
|
||||
return ['claro', 'olivero', 'stable', 'stark'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,9 +30,9 @@ class FunctionsTest extends KernelTestBase {
|
|||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
// Enable the Classy theme.
|
||||
$this->container->get('theme_installer')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
// Enable the Starterkit theme.
|
||||
$this->container->get('theme_installer')->install(['starterkit_theme']);
|
||||
$this->config('system.theme')->set('default', 'starterkit_theme')->save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -227,13 +227,13 @@ class FunctionsTest extends KernelTestBase {
|
|||
|
||||
$expected_links = '';
|
||||
$expected_links .= '<ul id="somelinks">';
|
||||
$expected_links .= '<li class="a-link"><a href="' . Url::fromUri('base:a/link')->toString() . '">' . Html::escape('A <link>') . '</a></li>';
|
||||
$expected_links .= '<li class="plain-text">' . Html::escape('Plain "text"') . '</li>';
|
||||
$expected_links .= '<li class="html-text"><span class="unescaped">' . Html::escape('potentially unsafe text that <should> be escaped') . '</span></li>';
|
||||
$expected_links .= '<li class="front-page"><a href="' . Url::fromRoute('<front>')->toString() . '">' . Html::escape('Front page') . '</a></li>';
|
||||
$expected_links .= '<li class="router-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '">' . Html::escape('Test route') . '</a></li>';
|
||||
$expected_links .= '<li><a href="' . Url::fromUri('base:a/link')->toString() . '">' . Html::escape('A <link>') . '</a></li>';
|
||||
$expected_links .= '<li>' . Html::escape('Plain "text"') . '</li>';
|
||||
$expected_links .= '<li><span class="unescaped">' . Html::escape('potentially unsafe text that <should> be escaped') . '</span></li>';
|
||||
$expected_links .= '<li><a href="' . Url::fromRoute('<front>')->toString() . '">' . Html::escape('Front page') . '</a></li>';
|
||||
$expected_links .= '<li><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '">' . Html::escape('Test route') . '</a></li>';
|
||||
$query = ['key' => 'value'];
|
||||
$expected_links .= '<li class="query-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1', $query) . '">' . Html::escape('Query test route') . '</a></li>';
|
||||
$expected_links .= '<li><a href="' . \Drupal::urlGenerator()->generate('router_test.1', $query) . '">' . Html::escape('Query test route') . '</a></li>';
|
||||
$expected_links .= '</ul>';
|
||||
|
||||
// Verify that passing a string as heading works.
|
||||
|
@ -267,13 +267,13 @@ class FunctionsTest extends KernelTestBase {
|
|||
];
|
||||
$expected_links = '';
|
||||
$expected_links .= '<ul id="somelinks">';
|
||||
$expected_links .= '<li class="a-link"><a href="' . Url::fromUri('base:a/link')->toString() . '">' . Html::escape('A <link>') . '</a></li>';
|
||||
$expected_links .= '<li class="plain-text"><span class="a/class">' . Html::escape('Plain "text"') . '</span></li>';
|
||||
$expected_links .= '<li class="html-text"><span class="unescaped">' . Html::escape('potentially unsafe text that <should> be escaped') . '</span></li>';
|
||||
$expected_links .= '<li class="front-page"><a href="' . Url::fromRoute('<front>')->toString() . '">' . Html::escape('Front page') . '</a></li>';
|
||||
$expected_links .= '<li class="router-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '">' . Html::escape('Test route') . '</a></li>';
|
||||
$expected_links .= '<li><a href="' . Url::fromUri('base:a/link')->toString() . '">' . Html::escape('A <link>') . '</a></li>';
|
||||
$expected_links .= '<li><span class="a/class">' . Html::escape('Plain "text"') . '</span></li>';
|
||||
$expected_links .= '<li><span class="unescaped">' . Html::escape('potentially unsafe text that <should> be escaped') . '</span></li>';
|
||||
$expected_links .= '<li><a href="' . Url::fromRoute('<front>')->toString() . '">' . Html::escape('Front page') . '</a></li>';
|
||||
$expected_links .= '<li><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '">' . Html::escape('Test route') . '</a></li>';
|
||||
$query = ['key' => 'value'];
|
||||
$expected_links .= '<li class="query-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1', $query) . '">' . Html::escape('Query test route') . '</a></li>';
|
||||
$expected_links .= '<li><a href="' . \Drupal::urlGenerator()->generate('router_test.1', $query) . '">' . Html::escape('Query test route') . '</a></li>';
|
||||
$expected_links .= '</ul>';
|
||||
$expected = $expected_heading . $expected_links;
|
||||
$this->assertThemeOutput('links', $variables, $expected);
|
||||
|
@ -283,14 +283,14 @@ class FunctionsTest extends KernelTestBase {
|
|||
$variables['set_active_class'] = TRUE;
|
||||
$expected_links = '';
|
||||
$expected_links .= '<ul id="somelinks">';
|
||||
$expected_links .= '<li class="a-link"><a href="' . Url::fromUri('base:a/link')->toString() . '">' . Html::escape('A <link>') . '</a></li>';
|
||||
$expected_links .= '<li class="plain-text"><span class="a/class">' . Html::escape('Plain "text"') . '</span></li>';
|
||||
$expected_links .= '<li class="html-text"><span class="unescaped">' . Html::escape('potentially unsafe text that <should> be escaped') . '</span></li>';
|
||||
$expected_links .= '<li data-drupal-link-system-path="<front>" class="front-page"><a href="' . Url::fromRoute('<front>')->toString() . '" data-drupal-link-system-path="<front>">' . Html::escape('Front page') . '</a></li>';
|
||||
$expected_links .= '<li data-drupal-link-system-path="router_test/test1" class="router-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '" data-drupal-link-system-path="router_test/test1">' . Html::escape('Test route') . '</a></li>';
|
||||
$expected_links .= '<li><a href="' . Url::fromUri('base:a/link')->toString() . '">' . Html::escape('A <link>') . '</a></li>';
|
||||
$expected_links .= '<li><span class="a/class">' . Html::escape('Plain "text"') . '</span></li>';
|
||||
$expected_links .= '<li><span class="unescaped">' . Html::escape('potentially unsafe text that <should> be escaped') . '</span></li>';
|
||||
$expected_links .= '<li data-drupal-link-system-path="<front>"><a href="' . Url::fromRoute('<front>')->toString() . '" data-drupal-link-system-path="<front>">' . Html::escape('Front page') . '</a></li>';
|
||||
$expected_links .= '<li data-drupal-link-system-path="router_test/test1"><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '" data-drupal-link-system-path="router_test/test1">' . Html::escape('Test route') . '</a></li>';
|
||||
$query = ['key' => 'value'];
|
||||
$encoded_query = Html::escape(Json::encode($query));
|
||||
$expected_links .= '<li data-drupal-link-query="' . $encoded_query . '" data-drupal-link-system-path="router_test/test1" class="query-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1', $query) . '" data-drupal-link-query="' . $encoded_query . '" data-drupal-link-system-path="router_test/test1">' . Html::escape('Query test route') . '</a></li>';
|
||||
$expected_links .= '<li data-drupal-link-query="' . $encoded_query . '" data-drupal-link-system-path="router_test/test1"><a href="' . \Drupal::urlGenerator()->generate('router_test.1', $query) . '" data-drupal-link-query="' . $encoded_query . '" data-drupal-link-system-path="router_test/test1">' . Html::escape('Query test route') . '</a></li>';
|
||||
$expected_links .= '</ul>';
|
||||
$expected = $expected_heading . $expected_links;
|
||||
$this->assertThemeOutput('links', $variables, $expected);
|
||||
|
|
|
@ -21,5 +21,5 @@ libraries-override:
|
|||
css/base-remove.css: false
|
||||
|
||||
libraries-extend:
|
||||
classy/base:
|
||||
starterkit_theme/base:
|
||||
- test_basetheme/global-styling
|
||||
|
|
|
@ -2,4 +2,4 @@ name: 'Theme test messages'
|
|||
type: theme
|
||||
description: 'Test theme which provides another div for messages.'
|
||||
version: VERSION
|
||||
base theme: classy
|
||||
base theme: starterkit_theme
|
||||
|
|
|
@ -15,5 +15,5 @@ libraries-override:
|
|||
base:
|
||||
base-add.sub-remove.css: false
|
||||
libraries-extend:
|
||||
classy/base:
|
||||
starterkit_theme/base:
|
||||
- test_subtheme/global-styling
|
||||
|
|
|
@ -12,7 +12,7 @@ name: '<strong>Test theme</strong>'
|
|||
type: theme
|
||||
description: 'Theme for testing the theme system'
|
||||
version: VERSION
|
||||
base theme: classy
|
||||
base theme: starterkit_theme
|
||||
logo: images/logo2.svg
|
||||
libraries:
|
||||
- test_theme/global-styling
|
||||
|
@ -22,7 +22,7 @@ libraries-override:
|
|||
# Remove an entire library.
|
||||
core/drupal.progress: false
|
||||
# Replace particular library assets.
|
||||
classy/base:
|
||||
starterkit_theme/base:
|
||||
css:
|
||||
component:
|
||||
css/components/button.css: css/my-button.css
|
||||
|
@ -30,14 +30,14 @@ libraries-override:
|
|||
css/components/container-inline.css: /themes/my_theme/css/my-container-inline.css
|
||||
css/components/details.css: /themes/my_theme/css/my-details.css
|
||||
# Remove particular library assets.
|
||||
classy/dialog:
|
||||
starterkit_theme/dialog:
|
||||
css:
|
||||
component:
|
||||
css/components/dialog.css: false
|
||||
system/base:
|
||||
css:
|
||||
component:
|
||||
/core/themes/stable/css/system/components/js.module.css: false
|
||||
/core/themes/stable9/css/system/components/js.module.css: false
|
||||
# It works for JS as well.
|
||||
core/jquery:
|
||||
js:
|
||||
|
@ -46,12 +46,12 @@ libraries-override:
|
|||
core/drupal.dropbutton:
|
||||
css:
|
||||
component:
|
||||
/core/themes/stable/css/core/dropbutton/dropbutton.css: /themes/my_theme/css/dropbutton.css
|
||||
/core/themes/stable9/css/core/dropbutton/dropbutton.css: /themes/my_theme/css/dropbutton.css
|
||||
# Use stream wrappers.
|
||||
core/drupal.vertical-tabs:
|
||||
css:
|
||||
component:
|
||||
/core/themes/stable/css/core/vertical-tabs.css: public://my_css/vertical-tabs.css
|
||||
/core/themes/stable9/css/core/vertical-tabs.css: public://my_css/vertical-tabs.css
|
||||
# Use a protocol-relative URI.
|
||||
core/drupal.displace:
|
||||
js:
|
||||
|
|
|
@ -2,5 +2,5 @@ name: 'Test theme libraries empty'
|
|||
type: theme
|
||||
description: 'Test theme with empty libraries in theme.info.yml'
|
||||
version: VERSION
|
||||
base theme: classy
|
||||
base theme: starterkit_theme
|
||||
libraries:
|
||||
|
|
|
@ -2,9 +2,9 @@ name: 'Test theme libraries-extend'
|
|||
type: theme
|
||||
description: 'Test Theme with libraries-extend'
|
||||
version: VERSION
|
||||
base theme: classy
|
||||
base theme: starterkit_theme
|
||||
libraries-extend:
|
||||
classy/book-navigation:
|
||||
starterkit_theme/book-navigation:
|
||||
- test_theme_libraries_extend/extend_one
|
||||
- test_theme_libraries_extend/extend_two
|
||||
core/drupal.dialog:
|
||||
|
|
|
@ -2,7 +2,7 @@ name: 'Test theme libraries-override'
|
|||
type: theme
|
||||
description: 'Theme with drupalSettings libraries-override'
|
||||
version: VERSION
|
||||
base theme: classy
|
||||
base theme: starterkit_theme
|
||||
libraries-override:
|
||||
# drupalSettings libraries override. Should throw a
|
||||
# \Drupal\Core\Asset\Exception\InvalidLibrariesOverrideSpecificationException.
|
||||
|
|
|
@ -2,7 +2,7 @@ name: 'Test theme libraries-override'
|
|||
type: theme
|
||||
description: 'Theme with invalid libraries-override asset spec.'
|
||||
version: VERSION
|
||||
base theme: classy
|
||||
base theme: starterkit_theme
|
||||
libraries-override:
|
||||
# A malformed library asset name. Should throw a
|
||||
# \Drupal\Core\Asset\Exception\InvalidLibrariesOverrideSpecificationException.
|
||||
|
|
|
@ -26,7 +26,7 @@ class FieldRenderedEntityTranslationTest extends ViewTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -34,7 +34,7 @@ class FilterDateTest extends ViewTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* The date formatter.
|
||||
|
|
|
@ -31,7 +31,7 @@ class ContextualFiltersBlockContextTest extends ViewTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Views used by this test.
|
||||
|
@ -103,7 +103,7 @@ class ContextualFiltersBlockContextTest extends ViewTestBase {
|
|||
|
||||
// Place test block via block UI to check if contexts are correctly exposed.
|
||||
$this->drupalGet(
|
||||
'admin/structure/block/add/views_block:test_view_block_with_context-block_1/classy',
|
||||
'admin/structure/block/add/views_block:test_view_block_with_context-block_1/starterkit_theme',
|
||||
['query' => ['region' => 'content']]
|
||||
);
|
||||
$edit = [
|
||||
|
|
|
@ -24,7 +24,7 @@ class ContextualFiltersStringTest extends ViewTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Views used by this test.
|
||||
|
|
|
@ -29,7 +29,7 @@ class DisabledDisplayTest extends ViewTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
protected function setUp($import_test_views = TRUE, $modules = ['views_test_config']): void {
|
||||
parent::setUp($import_test_views, $modules);
|
||||
|
|
|
@ -30,7 +30,7 @@ class DisplayAttachmentTest extends ViewTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
protected function setUp($import_test_views = TRUE, $modules = ['views_test_config']): void {
|
||||
parent::setUp($import_test_views, $modules);
|
||||
|
|
|
@ -34,7 +34,7 @@ class DisplayFeedTest extends ViewTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
protected function setUp($import_test_views = TRUE, $modules = ['views_test_config']): void {
|
||||
parent::setUp($import_test_views, $modules);
|
||||
|
|
|
@ -32,7 +32,7 @@ class DisplayPageWebTest extends ViewTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -35,7 +35,7 @@ class ExposedFormTest extends ViewTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Nodes to test.
|
||||
|
|
|
@ -20,7 +20,7 @@ class StyleSummaryTest extends ViewTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -60,7 +60,7 @@ class StyleSummaryTest extends ViewTestBase {
|
|||
$this->drupalGet('test-summary');
|
||||
|
||||
// Ensure styles are properly added for summary views.
|
||||
$this->assertSession()->responseContains('stable/css/views/views.module.css');
|
||||
$this->assertSession()->responseContains('stable9/css/views/views.module.css');
|
||||
|
||||
$summary_list = $this->cssSelect('ul.views-summary li');
|
||||
$this->assertCount(4, $summary_list);
|
||||
|
|
|
@ -19,7 +19,7 @@ class RenderCacheWebTest extends ViewTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -34,7 +34,7 @@ class UserBatchActionTest extends BrowserTestBase {
|
|||
* Tests user admin batch.
|
||||
*/
|
||||
public function testUserAction() {
|
||||
$themes = ['classy', 'olivero', 'claro'];
|
||||
$themes = ['stark', 'olivero', 'claro'];
|
||||
$this->container->get('theme_installer')->install($themes);
|
||||
|
||||
$this->drupalLogin($this->rootUser);
|
||||
|
|
|
@ -21,7 +21,7 @@ class ViewElementTest extends ViewTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -32,7 +32,7 @@ class GlossaryViewTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
|
|
|
@ -244,7 +244,7 @@ class DisplayPageTest extends ViewsKernelTestBase {
|
|||
'html_list' => '//div[@class="item-list"]//li',
|
||||
];
|
||||
|
||||
$themes = ['classy', 'olivero', 'stable', 'stark', 'claro'];
|
||||
$themes = ['olivero', 'stable', 'stark', 'claro'];
|
||||
|
||||
foreach ($themes as $theme) {
|
||||
\Drupal::service('theme_installer')->install([$theme]);
|
||||
|
|
|
@ -8,4 +8,4 @@ dependencies:
|
|||
- drupal:dblog
|
||||
install: []
|
||||
themes:
|
||||
- classy
|
||||
- starterkit_theme
|
||||
|
|
|
@ -8,4 +8,4 @@ dependencies:
|
|||
install:
|
||||
- ban
|
||||
themes:
|
||||
- classy
|
||||
- starterkit_theme
|
||||
|
|
|
@ -19,7 +19,7 @@ class AjaxFormPageCacheTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -21,7 +21,7 @@ class DialogTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Tests sending non-JS and AJAX requests to open and manipulate modals.
|
||||
|
|
|
@ -19,7 +19,7 @@ class ElementValidationTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Tries to post an Ajax change to a form that has a validated element.
|
||||
|
|
|
@ -37,7 +37,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Tests basic page test.
|
||||
|
|
|
@ -53,7 +53,7 @@ class ContentEntityFormFieldValidationFilteringTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -34,7 +34,7 @@ class DeleteMultipleFormTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -27,7 +27,7 @@ class EntityBundleListCacheTest extends BrowserTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -15,7 +15,7 @@ class InstallerTranslationTest extends InstallerTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'classy';
|
||||
protected $defaultTheme = 'starterkit_theme';
|
||||
|
||||
/**
|
||||
* Overrides the language code in which to install Drupal.
|
||||
|
@ -108,7 +108,7 @@ class InstallerTranslationTest extends InstallerTestBase {
|
|||
$this->drupalGet('admin/config/development/performance');
|
||||
$this->submitForm($edit, 'Save configuration');
|
||||
$this->drupalGet('<front>');
|
||||
$this->assertSession()->responseContains('classy/css/components/action-links.css');
|
||||
$this->assertSession()->responseContains('starterkit_theme/css/components/action-links.css');
|
||||
|
||||
// Verify the strings from the translation files were imported.
|
||||
$test_samples = ['Save and continue', 'Anonymous'];
|
||||
|
|
|
@ -31,7 +31,7 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
|
|||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
$this->container->get('theme_installer')->install(['test_theme', 'classy']);
|
||||
$this->container->get('theme_installer')->install(['test_theme', 'starterkit_theme']);
|
||||
$this->libraryDiscovery = $this->container->get('library.discovery');
|
||||
}
|
||||
|
||||
|
@ -44,8 +44,9 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
|
|||
$this->activateTheme('test_theme');
|
||||
$this->assertNotEmpty($this->libraryDiscovery->getLibraryByName('test_theme', 'kitten'));
|
||||
|
||||
// Now make classy the active theme and assert that library is not added.
|
||||
$this->activateTheme('classy');
|
||||
// Now make starterkit_theme the active theme and assert that library is not
|
||||
// added.
|
||||
$this->activateTheme('starterkit_theme');
|
||||
$this->assertFalse($this->libraryDiscovery->getLibraryByName('test_theme', 'kitten'));
|
||||
}
|
||||
|
||||
|
@ -53,13 +54,14 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
|
|||
* Tests that libraries-override are applied to library definitions.
|
||||
*/
|
||||
public function testLibrariesOverride() {
|
||||
// Assert some classy libraries that will be overridden or removed.
|
||||
$this->activateTheme('classy');
|
||||
$this->assertAssetInLibrary('core/themes/classy/css/components/button.css', 'classy', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/themes/classy/css/components/collapse-processed.css', 'classy', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/themes/classy/css/components/container-inline.css', 'classy', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/themes/classy/css/components/details.css', 'classy', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/themes/classy/css/components/dialog.css', 'classy', 'dialog', 'css');
|
||||
// Assert some starterkit_theme libraries that will be overridden or
|
||||
// removed.
|
||||
$this->activateTheme('starterkit_theme');
|
||||
$this->assertAssetInLibrary('core/themes/starterkit_theme/css/components/button.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/themes/starterkit_theme/css/components/collapse-processed.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/themes/starterkit_theme/css/components/container-inline.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/themes/starterkit_theme/css/components/details.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/themes/starterkit_theme/css/components/dialog.css', 'starterkit_theme', 'dialog', 'css');
|
||||
|
||||
// Confirmatory assert on core library to be removed.
|
||||
$this->assertNotEmpty($this->libraryDiscovery->getLibraryByName('core', 'drupal.progress'), 'Confirmatory test on "core/drupal.progress"');
|
||||
|
@ -70,17 +72,18 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
|
|||
// Assert that entire library was correctly overridden.
|
||||
$this->assertEquals($this->libraryDiscovery->getLibraryByName('core', 'drupal.collapse'), $this->libraryDiscovery->getLibraryByName('test_theme', 'collapse'), 'Entire library correctly overridden.');
|
||||
|
||||
// Assert that classy library assets were correctly overridden or removed.
|
||||
$this->assertNoAssetInLibrary('core/themes/classy/css/components/button.css', 'classy', 'base', 'css');
|
||||
$this->assertNoAssetInLibrary('core/themes/classy/css/components/collapse-processed.css', 'classy', 'base', 'css');
|
||||
$this->assertNoAssetInLibrary('core/themes/classy/css/components/container-inline.css', 'classy', 'base', 'css');
|
||||
$this->assertNoAssetInLibrary('core/themes/classy/css/components/details.css', 'classy', 'base', 'css');
|
||||
$this->assertNoAssetInLibrary('core/themes/classy/css/components/dialog.css', 'classy', 'dialog', 'css');
|
||||
// Assert that starterkit_theme library assets were correctly overridden or
|
||||
// removed.
|
||||
$this->assertNoAssetInLibrary('core/themes/starterkit_theme/css/components/button.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertNoAssetInLibrary('core/themes/starterkit_theme/css/components/collapse-processed.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertNoAssetInLibrary('core/themes/starterkit_theme/css/components/container-inline.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertNoAssetInLibrary('core/themes/starterkit_theme/css/components/details.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertNoAssetInLibrary('core/themes/starterkit_theme/css/components/dialog.css', 'starterkit_theme', 'dialog', 'css');
|
||||
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_theme/css/my-button.css', 'classy', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_theme/css/my-collapse-processed.css', 'classy', 'base', 'css');
|
||||
$this->assertAssetInLibrary('themes/my_theme/css/my-container-inline.css', 'classy', 'base', 'css');
|
||||
$this->assertAssetInLibrary('themes/my_theme/css/my-details.css', 'classy', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_theme/css/my-button.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_theme/css/my-collapse-processed.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertAssetInLibrary('themes/my_theme/css/my-container-inline.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertAssetInLibrary('themes/my_theme/css/my-details.css', 'starterkit_theme', 'base', 'css');
|
||||
|
||||
// Assert that entire library was correctly removed.
|
||||
$this->assertFalse($this->libraryDiscovery->getLibraryByName('core', 'drupal.progress'), 'Entire library correctly removed.');
|
||||
|
@ -170,25 +173,39 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
|
|||
* Tests libraries-extend.
|
||||
*/
|
||||
public function testLibrariesExtend() {
|
||||
// Activate classy themes and verify the libraries are not extended.
|
||||
$this->activateTheme('classy');
|
||||
$this->assertNoAssetInLibrary('core/modules/system/tests/themes/test_theme_libraries_extend/css/extend_1.css', 'classy', 'book-navigation', 'css');
|
||||
$this->assertNoAssetInLibrary('core/modules/system/tests/themes/test_theme_libraries_extend/js/extend_1.js', 'classy', 'book-navigation', 'js');
|
||||
$this->assertNoAssetInLibrary('core/modules/system/tests/themes/test_theme_libraries_extend/css/extend_2.css', 'classy', 'book-navigation', 'css');
|
||||
// Simulate starterkit_theme defining the book-navigation library.
|
||||
// @see theme_test_library_info_alter()
|
||||
$this->container->get('state')
|
||||
->set('theme_test_library_info_alter starterkit_theme', [
|
||||
'book-navigation' => [
|
||||
'css' => [
|
||||
'component' => [
|
||||
'css/components/book-navigation.css' => [],
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
// Activate the theme that extends the book-navigation library in classy.
|
||||
// Activate starterkit_theme and verify the libraries are not extended.
|
||||
$this->activateTheme('starterkit_theme');
|
||||
$this->assertNoAssetInLibrary('core/modules/system/tests/themes/test_theme_libraries_extend/css/extend_1.css', 'starterkit_theme', 'book-navigation', 'css');
|
||||
$this->assertNoAssetInLibrary('core/modules/system/tests/themes/test_theme_libraries_extend/js/extend_1.js', 'starterkit_theme', 'book-navigation', 'js');
|
||||
$this->assertNoAssetInLibrary('core/modules/system/tests/themes/test_theme_libraries_extend/css/extend_2.css', 'starterkit_theme', 'book-navigation', 'css');
|
||||
|
||||
// Activate the theme that extends the book-navigation library in
|
||||
// starterkit_theme.
|
||||
$this->activateTheme('test_theme_libraries_extend');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_theme_libraries_extend/css/extend_1.css', 'classy', 'book-navigation', 'css');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_theme_libraries_extend/js/extend_1.js', 'classy', 'book-navigation', 'js');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_theme_libraries_extend/css/extend_2.css', 'classy', 'book-navigation', 'css');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_theme_libraries_extend/css/extend_1.css', 'starterkit_theme', 'book-navigation', 'css');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_theme_libraries_extend/js/extend_1.js', 'starterkit_theme', 'book-navigation', 'js');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_theme_libraries_extend/css/extend_2.css', 'starterkit_theme', 'book-navigation', 'css');
|
||||
|
||||
// Activate a sub theme and confirm that it inherits the library assets
|
||||
// extended in the base theme as well as its own.
|
||||
$this->assertNoAssetInLibrary('core/modules/system/tests/themes/test_basetheme/css/base-libraries-extend.css', 'classy', 'base', 'css');
|
||||
$this->assertNoAssetInLibrary('core/modules/system/tests/themes/test_subtheme/css/sub-libraries-extend.css', 'classy', 'base', 'css');
|
||||
$this->assertNoAssetInLibrary('core/modules/system/tests/themes/test_basetheme/css/base-libraries-extend.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertNoAssetInLibrary('core/modules/system/tests/themes/test_subtheme/css/sub-libraries-extend.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->activateTheme('test_subtheme');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_basetheme/css/base-libraries-extend.css', 'classy', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_subtheme/css/sub-libraries-extend.css', 'classy', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_basetheme/css/base-libraries-extend.css', 'starterkit_theme', 'base', 'css');
|
||||
$this->assertAssetInLibrary('core/modules/system/tests/themes/test_subtheme/css/sub-libraries-extend.css', 'starterkit_theme', 'base', 'css');
|
||||
|
||||
// Activate test theme that extends with a non-existent library. An
|
||||
// exception should be thrown.
|
||||
|
|
|
@ -61,7 +61,6 @@ class ResolvedLibraryDefinitionsFilesMatchTest extends KernelTestBase {
|
|||
*/
|
||||
protected $allThemes = [
|
||||
'claro',
|
||||
'classy',
|
||||
'olivero',
|
||||
'stable',
|
||||
'stark',
|
||||
|
|
|
@ -81,9 +81,9 @@ class TableTest extends KernelTestBase {
|
|||
'#empty' => 'Empty row.',
|
||||
];
|
||||
|
||||
// Enable the Classy theme.
|
||||
\Drupal::service('theme_installer')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
// Enable the Starterkit theme.
|
||||
\Drupal::service('theme_installer')->install(['starterkit_theme']);
|
||||
$this->config('system.theme')->set('default', 'starterkit_theme')->save();
|
||||
|
||||
$this->render($table);
|
||||
$this->removeWhiteSpace();
|
||||
|
|
|
@ -17,7 +17,7 @@ class ElementInfoIntegrationTest extends KernelTestBase {
|
|||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
$this->container->get('theme_installer')->install(['test_theme', 'classy']);
|
||||
$this->container->get('theme_installer')->install(['test_theme', 'starterkit_theme']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,7 +33,7 @@ class ElementInfoIntegrationTest extends KernelTestBase {
|
|||
/** @var \Drupal\Core\Render\ElementInfoManagerInterface $element_info */
|
||||
$element_info = $this->container->get('plugin.manager.element_info');
|
||||
|
||||
$theme_manager->setActiveTheme($theme_initializer->getActiveThemeByName('classy'));
|
||||
$theme_manager->setActiveTheme($theme_initializer->getActiveThemeByName('starterkit_theme'));
|
||||
$this->assertEquals(60, $element_info->getInfo('textfield')['#size']);
|
||||
|
||||
$theme_manager->setActiveTheme($theme_initializer->getActiveThemeByName('test_theme'));
|
||||
|
|
|
@ -20,9 +20,9 @@ class MessageTest extends KernelTestBase {
|
|||
* Tests setting messages output.
|
||||
*/
|
||||
public function testMessages() {
|
||||
// Enable the Classy theme.
|
||||
\Drupal::service('theme_installer')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
// Enable the Starterkit theme.
|
||||
\Drupal::service('theme_installer')->install(['starterkit_theme']);
|
||||
$this->config('system.theme')->set('default', 'starterkit_theme')->save();
|
||||
|
||||
\Drupal::messenger()->addError('An error occurred');
|
||||
\Drupal::messenger()->addStatus('But then something nice happened');
|
||||
|
|
Loading…
Reference in New Issue