Skip to content
Snippets Groups Projects
Commit 5645eeba authored by catch's avatar catch
Browse files

Issue #3281449 by longwave, nod_, deviantintegral: Update Core unit tests to...

Issue #3281449 by longwave, nod_, deviantintegral: Update Core unit tests to not use Bartik and Seven
parent 8b8be72e
No related branches found
No related tags found
No related merge requests found
...@@ -86,9 +86,6 @@ protected function setUp(): void { ...@@ -86,9 +86,6 @@ protected function setUp(): void {
$active_theme = $this->getMockBuilder('\Drupal\Core\Theme\ActiveTheme') $active_theme = $this->getMockBuilder('\Drupal\Core\Theme\ActiveTheme')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$active_theme->expects($this->any())
->method('getName')
->willReturn('bartik');
$this->themeManager->expects($this->any()) $this->themeManager->expects($this->any())
->method('getActiveTheme') ->method('getActiveTheme')
->willReturn($active_theme); ->willReturn($active_theme);
......
...@@ -81,7 +81,7 @@ public function testGrouper() { ...@@ -81,7 +81,7 @@ public function testGrouper() {
'type' => 'file', 'type' => 'file',
'weight' => 0.001, 'weight' => 0.001,
'preprocess' => TRUE, 'preprocess' => TRUE,
'data' => 'core/themes/bartik/css/base/elements.css', 'data' => 'core/themes/example/css/base/elements.css',
'basename' => 'elements.css', 'basename' => 'elements.css',
], ],
'print.css' => [ 'print.css' => [
...@@ -90,7 +90,7 @@ public function testGrouper() { ...@@ -90,7 +90,7 @@ public function testGrouper() {
'type' => 'file', 'type' => 'file',
'weight' => 0.003, 'weight' => 0.003,
'preprocess' => TRUE, 'preprocess' => TRUE,
'data' => 'core/themes/bartik/css/print.css', 'data' => 'core/themes/example/css/print.css',
'basename' => 'print.css', 'basename' => 'print.css',
], ],
]; ];
......
...@@ -311,12 +311,12 @@ public function testStarterKitFlag(): void { ...@@ -311,12 +311,12 @@ public function testStarterKitFlag(): void {
'--name="Test custom starterkit theme"', '--name="Test custom starterkit theme"',
'--description="Custom theme generated from a starterkit theme"', '--description="Custom theme generated from a starterkit theme"',
'--starterkit', '--starterkit',
'bartik', 'olivero',
]; ];
$process = new Process($install_command, NULL); $process = new Process($install_command, NULL);
$process->setTimeout(60); $process->setTimeout(60);
$result = $process->run(); $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); $this->assertSame(1, $result);
} }
......
...@@ -141,13 +141,6 @@ protected function populateFilesystemStructure(array &$filesystem_structure) { ...@@ -141,13 +141,6 @@ protected function populateFilesystemStructure(array &$filesystem_structure) {
'core/modules/user/user.info.yml' => [], 'core/modules/user/user.info.yml' => [],
'profiles/other_profile/modules/other_profile_nested_module/other_profile_nested_module.info.yml' => [], 'profiles/other_profile/modules/other_profile_nested_module/other_profile_nested_module.info.yml' => [],
'core/modules/system/system.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/devel/devel.info.yml' => [],
'modules/poorly_placed_theme/poorly_placed_theme.info.yml' => [ 'modules/poorly_placed_theme/poorly_placed_theme.info.yml' => [
'type' => 'theme', 'type' => 'theme',
......
...@@ -80,18 +80,18 @@ public function testRebuildThemeData() { ...@@ -80,18 +80,18 @@ public function testRebuildThemeData() {
$this->themeList->expects($this->once()) $this->themeList->expects($this->once())
->method('getList') ->method('getList')
->will($this->returnValue([ ->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(); $theme_data = $this->themeHandler->rebuildThemeData();
$this->assertCount(1, $theme_data); $this->assertCount(1, $theme_data);
$info = $theme_data['seven']; $info = $theme_data['stark'];
// Ensure some basic properties. // Ensure some basic properties.
$this->assertInstanceOf('Drupal\Core\Extension\Extension', $info); $this->assertInstanceOf('Drupal\Core\Extension\Extension', $info);
$this->assertEquals('seven', $info->getName()); $this->assertEquals('stark', $info->getName());
$this->assertEquals('core/themes/seven/seven.info.yml', $info->getPathname()); $this->assertEquals('core/themes/stark/stark.info.yml', $info->getPathname());
$this->assertEquals('core/themes/seven/seven.theme', $info->getExtensionPathname()); $this->assertEquals('core/themes/stark/stark.theme', $info->getExtensionPathname());
} }
......
...@@ -45,7 +45,7 @@ protected function setUp(): void { ...@@ -45,7 +45,7 @@ protected function setUp(): void {
parent::setUp(); parent::setUp();
$this->tokenGenerator = $this->prophesize(CsrfTokenGenerator::class); $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->requestStack = new RequestStack();
$this->negotiator = new AjaxBasePageNegotiator($this->tokenGenerator->reveal(), $config_factory, $this->requestStack); $this->negotiator = new AjaxBasePageNegotiator($this->tokenGenerator->reveal(), $config_factory, $this->requestStack);
} }
...@@ -68,8 +68,8 @@ public function providerTestApplies() { ...@@ -68,8 +68,8 @@ public function providerTestApplies() {
$data = []; $data = [];
$data['empty'] = [[], FALSE]; $data['empty'] = [[], FALSE];
$data['no_theme'] = [['ajax_page_state' => ['theme' => '', 'theme_token' => '']], 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_empty_theme_token'] = [['ajax_page_state' => ['theme' => 'claro', 'theme_token' => '']], TRUE];
$data['valid_theme_valid_theme_token'] = [['ajax_page_state' => ['theme' => 'seven', 'theme_token' => 'valid_theme_token']], TRUE]; $data['valid_theme_valid_theme_token'] = [['ajax_page_state' => ['theme' => 'claro', 'theme_token' => 'valid_theme_token']], TRUE];
return $data; return $data;
} }
...@@ -77,7 +77,7 @@ public function providerTestApplies() { ...@@ -77,7 +77,7 @@ public function providerTestApplies() {
* @covers ::determineActiveTheme * @covers ::determineActiveTheme
*/ */
public function testDetermineActiveThemeValidToken() { public function testDetermineActiveThemeValidToken() {
$theme = 'seven'; $theme = 'claro';
$theme_token = 'valid_theme_token'; $theme_token = 'valid_theme_token';
$request = new Request([], ['ajax_page_state' => ['theme' => $theme, 'theme_token' => $theme_token]]); $request = new Request([], ['ajax_page_state' => ['theme' => $theme, 'theme_token' => $theme_token]]);
...@@ -95,7 +95,7 @@ public function testDetermineActiveThemeValidToken() { ...@@ -95,7 +95,7 @@ public function testDetermineActiveThemeValidToken() {
* @covers ::determineActiveTheme * @covers ::determineActiveTheme
*/ */
public function testDetermineActiveThemeInvalidToken() { public function testDetermineActiveThemeInvalidToken() {
$theme = 'seven'; $theme = 'claro';
$theme_token = 'invalid_theme_token'; $theme_token = 'invalid_theme_token';
$request = new Request([], ['ajax_page_state' => ['theme' => $theme, 'theme_token' => $theme_token]]); $request = new Request([], ['ajax_page_state' => ['theme' => $theme, 'theme_token' => $theme_token]]);
...@@ -113,7 +113,7 @@ public function testDetermineActiveThemeInvalidToken() { ...@@ -113,7 +113,7 @@ public function testDetermineActiveThemeInvalidToken() {
* @covers ::determineActiveTheme * @covers ::determineActiveTheme
*/ */
public function testDetermineActiveThemeDefaultTheme() { public function testDetermineActiveThemeDefaultTheme() {
$theme = 'bartik'; $theme = 'stark';
// When the theme is the system default, an empty string is provided as the // When the theme is the system default, an empty string is provided as the
// theme token. See system_js_settings_alter(). // theme token. See system_js_settings_alter().
$theme_token = ''; $theme_token = '';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment