Issue #3281449 by longwave, nod_, deviantintegral: Update Core unit tests to not use Bartik and Seven

(cherry picked from commit 5645eeba07)
merge-requests/2476/head
catch 2022-07-22 13:51:58 +09:00
parent 775602486f
commit fa54f53f07
6 changed files with 15 additions and 25 deletions

View File

@ -86,9 +86,6 @@ class AssetResolverTest extends UnitTestCase {
$active_theme = $this->getMockBuilder('\Drupal\Core\Theme\ActiveTheme')
->disableOriginalConstructor()
->getMock();
$active_theme->expects($this->any())
->method('getName')
->willReturn('bartik');
$this->themeManager->expects($this->any())
->method('getActiveTheme')
->willReturn($active_theme);

View File

@ -81,7 +81,7 @@ class CssCollectionGrouperUnitTest extends UnitTestCase {
'type' => 'file',
'weight' => 0.001,
'preprocess' => TRUE,
'data' => 'core/themes/bartik/css/base/elements.css',
'data' => 'core/themes/example/css/base/elements.css',
'basename' => 'elements.css',
],
'print.css' => [
@ -90,7 +90,7 @@ class CssCollectionGrouperUnitTest extends UnitTestCase {
'type' => 'file',
'weight' => 0.003,
'preprocess' => TRUE,
'data' => 'core/themes/bartik/css/print.css',
'data' => 'core/themes/example/css/print.css',
'basename' => 'print.css',
],
];

View File

@ -311,12 +311,12 @@ SH;
'--name="Test custom starterkit theme"',
'--description="Custom theme generated from a starterkit theme"',
'--starterkit',
'bartik',
'olivero',
];
$process = new Process($install_command, NULL);
$process->setTimeout(60);
$result = $process->run();
$this->assertStringContainsString('Theme source theme bartik is not a valid starter kit.', trim($process->getErrorOutput()));
$this->assertStringContainsString('Theme source theme olivero is not a valid starter kit.', trim($process->getErrorOutput()));
$this->assertSame(1, $result);
}

View File

@ -141,13 +141,6 @@ class ExtensionDiscoveryTest extends UnitTestCase {
'core/modules/user/user.info.yml' => [],
'profiles/other_profile/modules/other_profile_nested_module/other_profile_nested_module.info.yml' => [],
'core/modules/system/system.info.yml' => [],
'core/themes/seven/seven.info.yml' => [
'type' => 'theme',
],
// Override the core instance of the 'seven' theme.
'sites/default/themes/seven/seven.info.yml' => [
'type' => 'theme',
],
'modules/devel/devel.info.yml' => [],
'modules/poorly_placed_theme/poorly_placed_theme.info.yml' => [
'type' => 'theme',

View File

@ -80,18 +80,18 @@ class ThemeHandlerTest extends UnitTestCase {
$this->themeList->expects($this->once())
->method('getList')
->will($this->returnValue([
'seven' => new Extension($this->root, 'theme', 'core/themes/seven/seven.info.yml', 'seven.theme'),
'stark' => new Extension($this->root, 'theme', 'core/themes/stark/stark.info.yml', 'stark.theme'),
]));
$theme_data = $this->themeHandler->rebuildThemeData();
$this->assertCount(1, $theme_data);
$info = $theme_data['seven'];
$info = $theme_data['stark'];
// Ensure some basic properties.
$this->assertInstanceOf('Drupal\Core\Extension\Extension', $info);
$this->assertEquals('seven', $info->getName());
$this->assertEquals('core/themes/seven/seven.info.yml', $info->getPathname());
$this->assertEquals('core/themes/seven/seven.theme', $info->getExtensionPathname());
$this->assertEquals('stark', $info->getName());
$this->assertEquals('core/themes/stark/stark.info.yml', $info->getPathname());
$this->assertEquals('core/themes/stark/stark.theme', $info->getExtensionPathname());
}

View File

@ -45,7 +45,7 @@ class AjaxBasePageNegotiatorTest extends UnitTestCase {
parent::setUp();
$this->tokenGenerator = $this->prophesize(CsrfTokenGenerator::class);
$config_factory = $this->getConfigFactoryStub(['system.theme' => ['default' => 'bartik']]);
$config_factory = $this->getConfigFactoryStub(['system.theme' => ['default' => 'stark']]);
$this->requestStack = new RequestStack();
$this->negotiator = new AjaxBasePageNegotiator($this->tokenGenerator->reveal(), $config_factory, $this->requestStack);
}
@ -68,8 +68,8 @@ class AjaxBasePageNegotiatorTest extends UnitTestCase {
$data = [];
$data['empty'] = [[], FALSE];
$data['no_theme'] = [['ajax_page_state' => ['theme' => '', 'theme_token' => '']], FALSE];
$data['valid_theme_empty_theme_token'] = [['ajax_page_state' => ['theme' => 'seven', 'theme_token' => '']], TRUE];
$data['valid_theme_valid_theme_token'] = [['ajax_page_state' => ['theme' => 'seven', 'theme_token' => 'valid_theme_token']], TRUE];
$data['valid_theme_empty_theme_token'] = [['ajax_page_state' => ['theme' => 'claro', 'theme_token' => '']], TRUE];
$data['valid_theme_valid_theme_token'] = [['ajax_page_state' => ['theme' => 'claro', 'theme_token' => 'valid_theme_token']], TRUE];
return $data;
}
@ -77,7 +77,7 @@ class AjaxBasePageNegotiatorTest extends UnitTestCase {
* @covers ::determineActiveTheme
*/
public function testDetermineActiveThemeValidToken() {
$theme = 'seven';
$theme = 'claro';
$theme_token = 'valid_theme_token';
$request = new Request([], ['ajax_page_state' => ['theme' => $theme, 'theme_token' => $theme_token]]);
@ -95,7 +95,7 @@ class AjaxBasePageNegotiatorTest extends UnitTestCase {
* @covers ::determineActiveTheme
*/
public function testDetermineActiveThemeInvalidToken() {
$theme = 'seven';
$theme = 'claro';
$theme_token = 'invalid_theme_token';
$request = new Request([], ['ajax_page_state' => ['theme' => $theme, 'theme_token' => $theme_token]]);
@ -113,7 +113,7 @@ class AjaxBasePageNegotiatorTest extends UnitTestCase {
* @covers ::determineActiveTheme
*/
public function testDetermineActiveThemeDefaultTheme() {
$theme = 'bartik';
$theme = 'stark';
// When the theme is the system default, an empty string is provided as the
// theme token. See system_js_settings_alter().
$theme_token = '';