Commit fa54f53f 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

(cherry picked from commit 5645eeba)
parent 77560248
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -86,9 +86,6 @@ protected function setUp(): void {
    $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);
+2 −2
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ public function testGrouper() {
        '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 @@ public function testGrouper() {
        'type' => 'file',
        'weight' => 0.003,
        'preprocess' => TRUE,
        'data' => 'core/themes/bartik/css/print.css',
        'data' => 'core/themes/example/css/print.css',
        'basename' => 'print.css',
      ],
    ];
+2 −2
Original line number Diff line number Diff line
@@ -311,12 +311,12 @@ public function testStarterKitFlag(): void {
      '--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);
  }

+0 −7
Original line number Diff line number Diff line
@@ -141,13 +141,6 @@ protected function populateFilesystemStructure(array &$filesystem_structure) {
      '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',
+5 −5
Original line number Diff line number Diff line
@@ -80,18 +80,18 @@ public function testRebuildThemeData() {
    $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());

  }

Loading