Issue #3281454 by _shY, pooja saraah, deviantintegral, quietone, alexpott, nod_: Update various module tests to not use Bartik and Seven

(cherry picked from commit cd700d8409)
merge-requests/2357/merge
Lauri Eskola 2022-07-13 12:01:29 +03:00
parent 4d6ae45b5b
commit 8c03eb7525
No known key found for this signature in database
GPG Key ID: 382FC0F5B0DF53F8
13 changed files with 23 additions and 33 deletions

View File

@ -204,7 +204,7 @@ class BlockContentTypeTest extends BlockContentTestBase {
->getStorage('block_content');
// Install all themes.
$themes = ['bartik', 'olivero', 'seven', 'stark'];
$themes = ['olivero', 'stark', 'claro'];
\Drupal::service('theme_installer')->install($themes);
$theme_settings = $this->config('system.theme');
foreach ($themes as $default_theme) {
@ -220,15 +220,7 @@ class BlockContentTypeTest extends BlockContentTestBase {
$this->drupalGet($path);
$this->clickLink('Place block');
$this->clickLink('Add custom block');
// The seven theme has markup inside the link, we cannot use clickLink().
if ($default_theme == 'seven') {
$options = $theme != $default_theme ? ['query' => ['theme' => $theme]] : [];
$this->assertSession()->linkByHrefExists(Url::fromRoute('block_content.add_form', ['block_content_type' => 'foo'], $options)->toString());
$this->drupalGet('block/add/foo', $options);
}
else {
$this->clickLink('foo');
}
$this->clickLink('foo');
// Create a new block.
$edit = ['info[0][value]' => $this->randomMachineName(8)];
$this->submitForm($edit, 'Save');

View File

@ -185,7 +185,7 @@ class BreakpointDiscoveryTest extends KernelTestBase {
*/
public function testBreakpointGroups() {
$expected = [
'bartik' => 'Bartik',
'olivero' => 'Olivero',
'breakpoint_module_test' => 'Breakpoint test module',
'breakpoint_theme_test' => 'Breakpoint test theme',
'breakpoint_theme_test.group2' => 'breakpoint_theme_test.group2',

View File

@ -2,4 +2,4 @@ name: 'Breakpoint test theme'
type: theme
description: 'Test theme for breakpoint.'
version: VERSION
base theme: bartik
base theme: olivero

View File

@ -96,8 +96,8 @@ class AddedStylesheetsTest extends BrowserTestBase {
/** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */
$theme_installer = \Drupal::service('theme_installer');
$theme_installer->install(['test_ckeditor_stylesheets_relative', 'seven']);
$this->config('system.theme')->set('admin', 'seven')->save();
$theme_installer->install(['test_ckeditor_stylesheets_relative', 'claro']);
$this->config('system.theme')->set('admin', 'claro')->save();
$this->config('node.settings')->set('use_admin_theme', TRUE)->save();
$this->drupalGet('node/add/article');

View File

@ -18,7 +18,7 @@ class CommentDisplayConfigurableTest extends CommentTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'bartik';
protected $defaultTheme = 'olivero';
protected function setUp(): void {
parent::setUp();

View File

@ -102,7 +102,7 @@ class EditorImageDialogTest extends EntityKernelTestBase {
],
'_drupal_ajax' => '1',
'ajax_page_state' => [
'theme' => 'bartik',
'theme' => 'olivero',
'theme_token' => 'some-token',
'libraries' => '',
],

View File

@ -92,18 +92,18 @@ class MenuLinkContentTranslationUITest extends ContentTranslationUITestBase {
$this->drupalLogin($this->administrator);
$entityId = $this->createEntity([], 'en');
// Set up Seven as the admin theme to test.
$this->container->get('theme_installer')->install(['seven']);
// Set up the default admin theme to test.
$this->container->get('theme_installer')->install(['claro']);
$edit = [];
$edit['admin_theme'] = 'seven';
$edit['admin_theme'] = 'claro';
$this->drupalGet('admin/appearance');
$this->submitForm($edit, 'Save configuration');
// Check that edit uses the admin theme.
$this->drupalGet('admin/structure/menu/item/' . $entityId . '/edit');
$this->assertSession()->responseContains('core/themes/seven/css/base/elements.css');
$this->assertSession()->responseContains('core/themes/claro/css/base/elements.css');
// Check that translation uses admin theme as well.
$this->drupalGet('admin/structure/menu/item/' . $entityId . '/edit/translations');
$this->assertSession()->responseContains('core/themes/seven/css/base/elements.css');
$this->assertSession()->responseContains('core/themes/claro/css/base/elements.css');
}
/**

View File

@ -165,7 +165,6 @@ class NodeDisplayConfigurableTest extends NodeTestBase {
*/
public function provideThemes() {
return [
['bartik', 'header', TRUE],
['claro', 'footer', TRUE],
// @todo Remove Classy from data provider in
// https://www.drupal.org/project/drupal/issues/3110137.
@ -173,7 +172,6 @@ class NodeDisplayConfigurableTest extends NodeTestBase {
// @todo Add coverage for olivero after fixing
// https://www.drupal.org/project/drupal/issues/3215220.
// ['olivero', 'footer', TRUE],
['seven', 'footer', TRUE],
['stable', 'footer', FALSE],
['stable9', 'footer', FALSE],
];

View File

@ -252,16 +252,16 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
$this->drupalLogin($this->administrator);
$article = $this->drupalCreateNode(['type' => 'article', 'langcode' => $this->langcodes[0]]);
// Set up Seven as the admin theme and use it for node editing.
$this->container->get('theme_installer')->install(['seven']);
// Set up the default admin theme and use it for node editing.
$this->container->get('theme_installer')->install(['claro']);
$edit = [];
$edit['admin_theme'] = 'seven';
$edit['admin_theme'] = 'claro';
$edit['use_admin_theme'] = TRUE;
$this->drupalGet('admin/appearance');
$this->submitForm($edit, 'Save configuration');
$this->drupalGet('node/' . $article->id() . '/translations');
// Verify that translation uses the admin theme if edit is admin.
$this->assertSession()->responseContains('core/themes/seven/css/base/elements.css');
$this->assertSession()->responseContains('core/themes/claro/css/base/elements.css');
// Turn off admin theme for editing, assert inheritance to translations.
$edit['use_admin_theme'] = FALSE;
@ -269,7 +269,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
$this->submitForm($edit, 'Save configuration');
$this->drupalGet('node/' . $article->id() . '/translations');
// Verify that translation uses the frontend theme if edit is frontend.
$this->assertSession()->responseNotContains('core/themes/seven/css/base/elements.css');
$this->assertSession()->responseNotContains('core/themes/claro/css/base/elements.css');
// Assert presence of translation page itself (vs. DisabledBundle below).
$this->assertSession()->statusCodeEquals(200);

View File

@ -106,13 +106,13 @@ class ResponsiveImageStyleConfigEntityUnitTest extends UnitTestCase {
$this->breakpointManager->expects($this->any())
->method('getGroupProviders')
->with('test_group')
->willReturn(['bartik' => 'theme', 'toolbar' => 'module']);
->willReturn(['olivero' => 'theme', 'toolbar' => 'module']);
\Drupal::getContainer()->set('entity_type.repository', $entity_type_repository);
$dependencies = $entity->calculateDependencies()->getDependencies();
$this->assertEquals(['toolbar'], $dependencies['module']);
$this->assertEquals(['bartik'], $dependencies['theme']);
$this->assertEquals(['olivero'], $dependencies['theme']);
$this->assertEquals(['image.style.fallback', 'image.style.large', 'image.style.medium', 'image.style.small'], $dependencies['config']);
}

View File

@ -30,7 +30,7 @@ class SearchAdminThemeTest extends BrowserTestBase {
*
* @var string
*/
protected $adminTheme = 'seven';
protected $adminTheme = 'claro';
/**
* {@inheritdoc}

View File

@ -34,7 +34,7 @@ class UserBatchActionTest extends BrowserTestBase {
* Tests user admin batch.
*/
public function testUserAction() {
$themes = ['bartik', 'classy', 'olivero', 'seven', 'test_subseven'];
$themes = ['classy', 'olivero', 'claro'];
$this->container->get('theme_installer')->install($themes);
$this->drupalLogin($this->rootUser);

View File

@ -244,7 +244,7 @@ class DisplayPageTest extends ViewsKernelTestBase {
'html_list' => '//div[@class="item-list"]//li',
];
$themes = ['bartik', 'classy', 'olivero', 'seven', 'stable', 'stark'];
$themes = ['classy', 'olivero', 'stable', 'stark', 'claro'];
foreach ($themes as $theme) {
\Drupal::service('theme_installer')->install([$theme]);