EngineNyanCatTest.php

Same filename in other branches
  1. 9 core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php
  2. 10 core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php
  3. 11.x core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php

Namespace

Drupal\Tests\system\Functional\Theme

File

core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php

View source
<?php

namespace Drupal\Tests\system\Functional\Theme;

use Drupal\Tests\BrowserTestBase;

/**
 * Tests the multi theme engine support.
 *
 * @group Theme
 */
class EngineNyanCatTest extends BrowserTestBase {
    
    /**
     * Modules to enable.
     *
     * @var array
     */
    public static $modules = [
        'theme_test',
    ];
    
    /**
     * {@inheritdoc}
     */
    protected $defaultTheme = 'stark';
    protected function setUp() {
        parent::setUp();
        \Drupal::service('theme_installer')->install([
            'test_theme_nyan_cat_engine',
        ]);
    }
    
    /**
     * Ensures a theme's template is overridable based on the 'template' filename.
     */
    public function testTemplateOverride() {
        $this->config('system.theme')
            ->set('default', 'test_theme_nyan_cat_engine')
            ->save();
        $this->drupalGet('theme-test/template-test');
        $this->assertText('Success: Template overridden with Nyan Cat theme. All of them', 'Template overridden by Nyan Cat file.');
    }

}

Classes

Title Deprecated Summary
EngineNyanCatTest Tests the multi theme engine support.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.