class EngineNyanCatTest
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php \Drupal\Tests\system\Functional\Theme\EngineNyanCatTest
- 10 core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php \Drupal\Tests\system\Functional\Theme\EngineNyanCatTest
- 8.9.x core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php \Drupal\Tests\system\Functional\Theme\EngineNyanCatTest
Tests the multi theme engine support.
@group Theme
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Functional\Theme\EngineNyanCatTest extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of EngineNyanCatTest
File
-
core/
modules/ system/ tests/ src/ Functional/ Theme/ EngineNyanCatTest.php, line 12
Namespace
Drupal\Tests\system\Functional\ThemeView source
class EngineNyanCatTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'theme_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
\Drupal::service('theme_installer')->install([
'test_theme_nyan_cat_engine',
]);
}
/**
* Ensures a theme's template is overridable based on the 'template' filename.
*
* @group legacy
*
* @todo https://www.drupal.org/project/drupal/issues/3246981 Remove
* nyan_cat_init() and the legacy group and expected deprecation from this
* test.
*/
public function testTemplateOverride() {
$this->expectDeprecation('THEME_ENGINE_init() is deprecated in drupal:9.3.0 and removed in drupal:10.0.0. There is no replacement. See https://www.drupal.org/node/3246978');
$this->config('system.theme')
->set('default', 'test_theme_nyan_cat_engine')
->save();
$this->drupalGet('theme-test/template-test');
$this->assertSession()
->pageTextContains('Success: Template overridden with Nyan Cat theme. All of them');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.