class ThemeInstallerTest in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest
Tests installing and uninstalling of themes.
@group Extension
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \PHPUnit\Framework\TestCase implements ServiceProviderInterface uses AssertContentTrait, AssertLegacyTrait, AssertHelperTrait, ConfigTestTrait, PhpunitCompatibilityTrait, RandomGeneratorTrait, TestRequirementsTrait
- class \Drupal\KernelTests\Core\Theme\ThemeInstallerTest
Expanded class hierarchy of ThemeInstallerTest
File
- core/
tests/ Drupal/ KernelTests/ Core/ Theme/ ThemeInstallerTest.php, line 17
Namespace
Drupal\KernelTests\Core\ThemeView source
class ThemeInstallerTest extends KernelTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = [
'system',
];
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
parent::register($container);
// Some test methods involve ModuleHandler operations, which attempt to
// rebuild and dump routes.
$container
->register('router.dumper', 'Drupal\\Core\\Routing\\NullMatcherDumper');
}
protected function setUp() {
parent::setUp();
$this
->installConfig([
'system',
]);
}
/**
* Verifies that no themes are installed by default.
*/
public function testEmpty() {
$this
->assertEmpty($this
->extensionConfig()
->get('theme'));
$this
->assertEmpty(array_keys($this
->themeHandler()
->listInfo()));
$this
->assertEmpty(array_keys(\Drupal::service('theme_handler')
->listInfo()));
// Rebuilding available themes should always yield results though.
$this
->assertNotEmpty($this
->themeHandler()
->rebuildThemeData()['stark'], 'ThemeHandler::rebuildThemeData() yields all available themes.');
// theme_get_setting() should return global default theme settings.
$this
->assertIdentical(theme_get_setting('features.favicon'), TRUE);
}
/**
* Tests installing a theme.
*/
public function testInstall() {
$name = 'test_basetheme';
$themes = $this
->themeHandler()
->listInfo();
$this
->assertFalse(isset($themes[$name]));
$this
->themeInstaller()
->install([
$name,
]);
$this
->assertIdentical($this
->extensionConfig()
->get("theme.{$name}"), 0);
$themes = $this
->themeHandler()
->listInfo();
$this
->assertTrue(isset($themes[$name]));
$this
->assertEqual($themes[$name]
->getName(), $name);
// Verify that test_basetheme.settings is active.
$this
->assertIdentical(theme_get_setting('features.favicon', $name), FALSE);
$this
->assertEqual(theme_get_setting('base', $name), 'only');
$this
->assertEqual(theme_get_setting('override', $name), 'base');
}
/**
* Tests installing a sub-theme.
*/
public function testInstallSubTheme() {
$name = 'test_subtheme';
$base_name = 'test_basetheme';
$themes = $this
->themeHandler()
->listInfo();
$this
->assertEmpty(array_keys($themes));
$this
->themeInstaller()
->install([
$name,
]);
$themes = $this
->themeHandler()
->listInfo();
$this
->assertTrue(isset($themes[$name]));
$this
->assertTrue(isset($themes[$base_name]));
$this
->themeInstaller()
->uninstall([
$name,
]);
$themes = $this
->themeHandler()
->listInfo();
$this
->assertFalse(isset($themes[$name]));
$this
->assertTrue(isset($themes[$base_name]));
}
/**
* Tests installing a non-existing theme.
*/
public function testInstallNonExisting() {
$name = 'non_existing_theme';
$themes = $this
->themeHandler()
->listInfo();
$this
->assertEmpty(array_keys($themes));
try {
$message = 'ThemeInstaller::install() throws UnknownExtensionException upon installing a non-existing theme.';
$this
->themeInstaller()
->install([
$name,
]);
$this
->fail($message);
} catch (\Exception $e) {
$this
->assertInstanceOf(UnknownExtensionException::class, $e);
}
$themes = $this
->themeHandler()
->listInfo();
$this
->assertEmpty(array_keys($themes));
}
/**
* Tests installing a theme with a too long name.
*/
public function testInstallNameTooLong() {
$name = 'test_theme_having_veery_long_name_which_is_too_long';
try {
$message = 'ThemeInstaller::install() throws ExtensionNameLengthException upon installing a theme with a too long name.';
$this
->themeInstaller()
->install([
$name,
]);
$this
->fail($message);
} catch (\Exception $e) {
$this
->assertInstanceOf(ExtensionNameLengthException::class, $e);
}
}
/**
* Tests installing a theme with unmet module dependencies.
*
* @dataProvider providerTestInstallThemeWithUnmetModuleDependencies
*/
public function testInstallThemeWithUnmetModuleDependencies($theme_name, $installed_modules, $message) {
$this->container
->get('module_installer')
->install($installed_modules);
$themes = $this
->themeHandler()
->listInfo();
$this
->assertEmpty($themes);
$this
->expectException(MissingDependencyException::class);
$this
->expectExceptionMessage($message);
$this
->themeInstaller()
->install([
$theme_name,
]);
}
/**
* Data provider for testInstallThemeWithUnmetModuleDependencies().
*/
public function providerTestInstallThemeWithUnmetModuleDependencies() {
return [
'theme with uninstalled module dependencies' => [
'test_theme_depending_on_modules',
[],
"Unable to install theme: 'test_theme_depending_on_modules' due to unmet module dependencies: 'test_module_required_by_theme, test_another_module_required_by_theme'.",
],
'theme with a base theme with uninstalled module dependencies' => [
'test_theme_with_a_base_theme_depending_on_modules',
[],
"Unable to install theme: 'test_theme_with_a_base_theme_depending_on_modules' due to unmet module dependencies: 'test_module_required_by_theme, test_another_module_required_by_theme'.",
],
'theme and base theme have uninstalled module dependencies' => [
'test_theme_mixed_module_dependencies',
[],
"Unable to install theme: 'test_theme_mixed_module_dependencies' due to unmet module dependencies: 'help, test_module_required_by_theme, test_another_module_required_by_theme'.",
],
'theme with already installed module dependencies, base theme module dependencies are not installed' => [
'test_theme_mixed_module_dependencies',
[
'help',
],
"Unable to install theme: 'test_theme_mixed_module_dependencies' due to unmet module dependencies: 'test_module_required_by_theme, test_another_module_required_by_theme'.",
],
'theme with module dependencies not installed, base theme module dependencies are already installed, ' => [
'test_theme_mixed_module_dependencies',
[
'test_module_required_by_theme',
'test_another_module_required_by_theme',
],
"Unable to install theme: 'test_theme_mixed_module_dependencies' due to unmet module dependencies: 'help'.",
],
'theme depending on a module that does not exist' => [
'test_theme_depending_on_nonexisting_module',
[],
"Unable to install theme: 'test_theme_depending_on_nonexisting_module' due to unmet module dependencies: 'test_module_non_existing",
],
'theme depending on an installed but incompatible module' => [
'test_theme_depending_on_constrained_modules',
[
'test_module_compatible_constraint',
'test_module_incompatible_constraint',
],
"Unable to install theme: Test Module Theme Depends on with Incompatible Constraint (>=8.x-2.x) (incompatible with version 8.x-1.8)",
],
];
}
/**
* Tests installing a theme with module dependencies that are met.
*/
public function testInstallThemeWithMetModuleDependencies() {
$name = 'test_theme_depending_on_modules';
$themes = $this
->themeHandler()
->listInfo();
$this
->assertArrayNotHasKey($name, $themes);
$this->container
->get('module_installer')
->install([
'test_module_required_by_theme',
'test_another_module_required_by_theme',
]);
$this
->themeInstaller()
->install([
$name,
]);
$themes = $this
->themeHandler()
->listInfo();
$this
->assertArrayHasKey($name, $themes);
$this
->expectException(ModuleUninstallValidatorException::class);
$this
->expectExceptionMessage('The following reasons prevent the modules from being uninstalled: Required by the theme: Test Theme Depending on Modules');
$this->container
->get('module_installer')
->uninstall([
'test_module_required_by_theme',
]);
}
/**
* Tests uninstalling the default theme.
*/
public function testUninstallDefault() {
$name = 'stark';
$other_name = 'bartik';
$this
->themeInstaller()
->install([
$name,
$other_name,
]);
$this
->config('system.theme')
->set('default', $name)
->save();
$themes = $this
->themeHandler()
->listInfo();
$this
->assertTrue(isset($themes[$name]));
$this
->assertTrue(isset($themes[$other_name]));
try {
$message = 'ThemeInstaller::uninstall() throws InvalidArgumentException upon disabling default theme.';
$this
->themeInstaller()
->uninstall([
$name,
]);
$this
->fail($message);
} catch (\Exception $e) {
$this
->assertInstanceOf(\InvalidArgumentException::class, $e);
}
$themes = $this
->themeHandler()
->listInfo();
$this
->assertTrue(isset($themes[$name]));
$this
->assertTrue(isset($themes[$other_name]));
}
/**
* Tests uninstalling the admin theme.
*/
public function testUninstallAdmin() {
$name = 'stark';
$other_name = 'bartik';
$this
->themeInstaller()
->install([
$name,
$other_name,
]);
$this
->config('system.theme')
->set('admin', $name)
->save();
$themes = $this
->themeHandler()
->listInfo();
$this
->assertTrue(isset($themes[$name]));
$this
->assertTrue(isset($themes[$other_name]));
try {
$message = 'ThemeInstaller::uninstall() throws InvalidArgumentException upon disabling admin theme.';
$this
->themeInstaller()
->uninstall([
$name,
]);
$this
->fail($message);
} catch (\Exception $e) {
$this
->assertInstanceOf(\InvalidArgumentException::class, $e);
}
$themes = $this
->themeHandler()
->listInfo();
$this
->assertTrue(isset($themes[$name]));
$this
->assertTrue(isset($themes[$other_name]));
}
/**
* Tests uninstalling a sub-theme.
*/
public function testUninstallSubTheme() {
$name = 'test_subtheme';
$base_name = 'test_basetheme';
$this
->themeInstaller()
->install([
$name,
]);
$this
->themeInstaller()
->uninstall([
$name,
]);
$themes = $this
->themeHandler()
->listInfo();
$this
->assertFalse(isset($themes[$name]));
$this
->assertTrue(isset($themes[$base_name]));
}
/**
* Tests uninstalling a base theme before its sub-theme.
*/
public function testUninstallBaseBeforeSubTheme() {
$name = 'test_basetheme';
$sub_name = 'test_subtheme';
$this
->themeInstaller()
->install([
$sub_name,
]);
try {
$message = 'ThemeInstaller::install() throws InvalidArgumentException upon uninstalling base theme before sub theme.';
$this
->themeInstaller()
->uninstall([
$name,
]);
$this
->fail($message);
} catch (\Exception $e) {
$this
->assertInstanceOf(\InvalidArgumentException::class, $e);
}
$themes = $this
->themeHandler()
->listInfo();
$this
->assertTrue(isset($themes[$name]));
$this
->assertTrue(isset($themes[$sub_name]));
// Verify that uninstalling both at the same time works.
$this
->themeInstaller()
->uninstall([
$name,
$sub_name,
]);
$themes = $this
->themeHandler()
->listInfo();
$this
->assertFalse(isset($themes[$name]));
$this
->assertFalse(isset($themes[$sub_name]));
}
/**
* Tests uninstalling a non-existing theme.
*/
public function testUninstallNonExisting() {
$name = 'non_existing_theme';
$themes = $this
->themeHandler()
->listInfo();
$this
->assertEmpty(array_keys($themes));
try {
$message = 'ThemeInstaller::uninstall() throws UnknownExtensionException upon uninstalling a non-existing theme.';
$this
->themeInstaller()
->uninstall([
$name,
]);
$this
->fail($message);
} catch (\Exception $e) {
$this
->assertInstanceOf(UnknownExtensionException::class, $e);
}
$themes = $this
->themeHandler()
->listInfo();
$this
->assertEmpty(array_keys($themes));
}
/**
* Tests uninstalling a theme.
*/
public function testUninstall() {
$name = 'test_basetheme';
$this
->themeInstaller()
->install([
$name,
]);
$this
->assertNotEmpty($this
->config("{$name}.settings")
->get());
$this
->themeInstaller()
->uninstall([
$name,
]);
$this
->assertEmpty(array_keys($this
->themeHandler()
->listInfo()));
$this
->assertEmpty($this
->config("{$name}.settings")
->get());
// Ensure that the uninstalled theme can be installed again.
$this
->themeInstaller()
->install([
$name,
]);
$themes = $this
->themeHandler()
->listInfo();
$this
->assertTrue(isset($themes[$name]));
$this
->assertEqual($themes[$name]
->getName(), $name);
$this
->assertNotEmpty($this
->config("{$name}.settings")
->get());
}
/**
* Tests uninstalling a theme that is not installed.
*/
public function testUninstallNotInstalled() {
$name = 'test_basetheme';
try {
$message = 'ThemeInstaller::uninstall() throws UnknownExtensionException upon uninstalling a theme that is not installed.';
$this
->themeInstaller()
->uninstall([
$name,
]);
$this
->fail($message);
} catch (\Exception $e) {
$this
->assertInstanceOf(UnknownExtensionException::class, $e);
}
}
/**
* Tests that theme info can be altered by a module.
*
* @see module_test_system_info_alter()
*/
public function testThemeInfoAlter() {
$name = 'seven';
$this->container
->get('state')
->set('module_test.hook_system_info_alter', TRUE);
$this
->themeInstaller()
->install([
$name,
]);
$themes = $this
->themeHandler()
->listInfo();
$this
->assertFalse(isset($themes[$name]->info['regions']['test_region']));
// Install module_test.
$this
->moduleInstaller()
->install([
'module_test',
], FALSE);
$this
->assertTrue($this
->moduleHandler()
->moduleExists('module_test'));
$themes = $this
->themeHandler()
->listInfo();
$this
->assertTrue(isset($themes[$name]->info['regions']['test_region']));
// Legacy assertions.
// @todo Remove once theme initialization/info has been modernized.
// @see https://www.drupal.org/node/2228093
$info = \Drupal::service('extension.list.theme')
->getExtensionInfo($name);
$this
->assertTrue(isset($info['regions']['test_region']));
$regions = system_region_list($name);
$this
->assertTrue(isset($regions['test_region']));
$theme_list = \Drupal::service('theme_handler')
->listInfo();
$this
->assertTrue(isset($theme_list[$name]->info['regions']['test_region']));
$this
->moduleInstaller()
->uninstall([
'module_test',
]);
$this
->assertFalse($this
->moduleHandler()
->moduleExists('module_test'));
$themes = $this
->themeHandler()
->listInfo();
$this
->assertFalse(isset($themes[$name]->info['regions']['test_region']));
// Legacy assertions.
// @todo Remove once theme initialization/info has been modernized.
// @see https://www.drupal.org/node/2228093
$info = \Drupal::service('extension.list.theme')
->getExtensionInfo($name);
$this
->assertFalse(isset($info['regions']['test_region']));
$regions = system_region_list($name);
$this
->assertFalse(isset($regions['test_region']));
$theme_list = \Drupal::service('theme_handler')
->listInfo();
$this
->assertFalse(isset($theme_list[$name]->info['regions']['test_region']));
}
/**
* Returns the theme handler service.
*
* @return \Drupal\Core\Extension\ThemeHandlerInterface
*/
protected function themeHandler() {
return $this->container
->get('theme_handler');
}
/**
* Returns the theme installer service.
*
* @return \Drupal\Core\Extension\ThemeInstallerInterface
*/
protected function themeInstaller() {
return $this->container
->get('theme_installer');
}
/**
* Returns the system.theme config object.
*
* @return \Drupal\Core\Config\Config
*/
protected function extensionConfig() {
return $this
->config('core.extension');
}
/**
* Returns the ModuleHandler.
*
* @return \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected function moduleHandler() {
return $this->container
->get('module_handler');
}
/**
* Returns the ModuleInstaller.
*
* @return \Drupal\Core\Extension\ModuleInstallerInterface
*/
protected function moduleInstaller() {
return $this->container
->get('module_installer');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AssertContentTrait:: |
protected | property | The current raw content. | |
AssertContentTrait:: |
protected | property | The drupalSettings value from the current raw $content. | |
AssertContentTrait:: |
protected | property | The XML structure parsed from the current raw $content. | 1 |
AssertContentTrait:: |
protected | property | The plain-text content of raw $content (text nodes). | |
AssertContentTrait:: |
protected | function | Passes if the raw text IS found escaped on the loaded page, fail otherwise. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists with the given name or ID. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists with the given ID and value. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists with the given name and value. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists in the current page by the given XPath. | |
AssertContentTrait:: |
protected | function | Asserts that a checkbox field in the current page is checked. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists in the current page with a given Xpath result. | |
AssertContentTrait:: |
protected | function | Passes if a link with the specified label is found. | |
AssertContentTrait:: |
protected | function | Passes if a link containing a given href (part) is found. | |
AssertContentTrait:: |
protected | function | Asserts that each HTML ID is used for just a single element. | |
AssertContentTrait:: |
protected | function | Passes if the raw text IS NOT found escaped on the loaded page, fail otherwise. | |
AssertContentTrait:: |
protected | function | Asserts that a field does not exist with the given name or ID. | |
AssertContentTrait:: |
protected | function | Asserts that a field does not exist with the given ID and value. | |
AssertContentTrait:: |
protected | function | Asserts that a field does not exist with the given name and value. | |
AssertContentTrait:: |
protected | function | Asserts that a field does not exist or its value does not match, by XPath. | |
AssertContentTrait:: |
protected | function | Asserts that a checkbox field in the current page is not checked. | |
AssertContentTrait:: |
protected | function | Passes if a link with the specified label is not found. | |
AssertContentTrait:: |
protected | function | Passes if a link containing a given href (part) is not found. | |
AssertContentTrait:: |
protected | function | Passes if a link containing a given href is not found in the main region. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page does not exist. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page is not checked. | |
AssertContentTrait:: |
protected | function | Triggers a pass if the perl regex pattern is not found in raw content. | |
AssertContentTrait:: |
protected | function | Passes if the raw text is NOT found on the loaded page, fail otherwise. | |
AssertContentTrait:: |
protected | function | Passes if the page (with HTML stripped) does not contains the text. | |
AssertContentTrait:: |
protected | function | Pass if the page title is not the given string. | |
AssertContentTrait:: |
protected | function | Passes if the text is found MORE THAN ONCE on the text version of the page. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page exists. | |
AssertContentTrait:: |
protected | function | Asserts that a select option with the visible text exists. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page is checked. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page is checked. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page exists. | |
AssertContentTrait:: |
protected | function | Triggers a pass if the Perl regex pattern is found in the raw content. | |
AssertContentTrait:: |
protected | function | Passes if the raw text IS found on the loaded page, fail otherwise. | |
AssertContentTrait:: |
protected | function | Passes if the page (with HTML stripped) contains the text. | |
AssertContentTrait:: |
protected | function | Helper for assertText and assertNoText. | |
AssertContentTrait:: |
protected | function | Asserts that a Perl regex pattern is found in the plain-text content. | |
AssertContentTrait:: |
protected | function | Asserts themed output. | |
AssertContentTrait:: |
protected | function | Pass if the page title is the given string. | |
AssertContentTrait:: |
protected | function | Passes if the text is found ONLY ONCE on the text version of the page. | |
AssertContentTrait:: |
protected | function | Helper for assertUniqueText and assertNoUniqueText. | |
AssertContentTrait:: |
protected | function | Builds an XPath query. | |
AssertContentTrait:: |
protected | function | Helper: Constructs an XPath for the given set of attributes and value. | |
AssertContentTrait:: |
protected | function | Searches elements using a CSS selector in the raw content. | |
AssertContentTrait:: |
protected | function | Get all option elements, including nested options, in a select. | |
AssertContentTrait:: |
protected | function | Gets the value of drupalSettings for the currently-loaded page. | |
AssertContentTrait:: |
protected | function | Gets the current raw content. | |
AssertContentTrait:: |
protected | function | Get the selected value from a select field. | |
AssertContentTrait:: |
protected | function | Retrieves the plain-text content from the current raw content. | |
AssertContentTrait:: |
protected | function | Get the current URL from the cURL handler. | 1 |
AssertContentTrait:: |
protected | function | Parse content returned from curlExec using DOM and SimpleXML. | |
AssertContentTrait:: |
protected | function | Removes all white-space between HTML tags from the raw content. | |
AssertContentTrait:: |
protected | function | Sets the value of drupalSettings for the currently-loaded page. | |
AssertContentTrait:: |
protected | function | Sets the raw content (e.g. HTML). | |
AssertContentTrait:: |
protected | function | Performs an xpath search on the contents of the internal browser. | |
AssertHelperTrait:: |
protected static | function | Casts MarkupInterface objects into strings. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertTrue() instead. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertEquals() instead. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertSame() instead. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertEquals() instead. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertNotEquals() instead. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertNotSame() instead. | |
AssertLegacyTrait:: |
protected | function | Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertTrue() instead. | |
AssertLegacyTrait:: |
protected | function | ||
ConfigTestTrait:: |
protected | function | Returns a ConfigImporter object to import test configuration. | |
ConfigTestTrait:: |
protected | function | Copies configuration objects from source storage to target storage. | |
KernelTestBase:: |
protected | property | Back up and restore any global variables that may be changed by tests. | |
KernelTestBase:: |
protected | property | Back up and restore static class properties that may be changed by tests. | |
KernelTestBase:: |
protected | property | Contains a few static class properties for performance. | |
KernelTestBase:: |
protected | property | ||
KernelTestBase:: |
protected | property | @todo Move into Config test base class. | 7 |
KernelTestBase:: |
protected static | property | An array of config object names that are excluded from schema checking. | |
KernelTestBase:: |
protected | property | ||
KernelTestBase:: |
protected | property | ||
KernelTestBase:: |
protected | property | Do not forward any global state from the parent process to the processes that run the actual tests. | |
KernelTestBase:: |
protected | property | The app root. | |
KernelTestBase:: |
protected | property | Kernel tests are run in separate processes because they allow autoloading of code from extensions. Running the test in a separate process isolates this behavior from other tests. Subclasses should not override this property. | |
KernelTestBase:: |
protected | property | ||
KernelTestBase:: |
protected | property | Set to TRUE to strict check all configuration saved. | 6 |
KernelTestBase:: |
protected | property | The virtual filesystem root directory. | |
KernelTestBase:: |
protected | function | 1 | |
KernelTestBase:: |
protected | function | Bootstraps a basic test environment. | |
KernelTestBase:: |
private | function | Bootstraps a kernel for a test. | |
KernelTestBase:: |
protected | function | Configuration accessor for tests. Returns non-overridden configuration. | |
KernelTestBase:: |
protected | function | Disables modules for this test. | |
KernelTestBase:: |
protected | function | Enables modules for this test. | |
KernelTestBase:: |
protected | function | Gets the config schema exclusions for this test. | |
KernelTestBase:: |
protected | function | Returns the Database connection info to be used for this test. | 1 |
KernelTestBase:: |
public | function | ||
KernelTestBase:: |
private | function | Returns Extension objects for $modules to enable. | |
KernelTestBase:: |
private static | function | Returns the modules to enable for this test. | |
KernelTestBase:: |
protected | function | Initializes the FileCache component. | |
KernelTestBase:: |
protected | function | Installs default configuration for a given list of modules. | |
KernelTestBase:: |
protected | function | Installs the storage schema for a specific entity type. | |
KernelTestBase:: |
protected | function | Installs database tables from a module schema definition. | |
KernelTestBase:: |
protected | function | Returns whether the current test method is running in a separate process. | |
KernelTestBase:: |
protected | function | ||
KernelTestBase:: |
protected | function | Renders a render array. | 1 |
KernelTestBase:: |
protected | function | Sets the install profile and rebuilds the container to update it. | |
KernelTestBase:: |
protected | function | Sets an in-memory Settings variable. | |
KernelTestBase:: |
public static | function | 1 | |
KernelTestBase:: |
protected | function | Sets up the filesystem, so things like the file directory. | 2 |
KernelTestBase:: |
protected | function | Stops test execution. | |
KernelTestBase:: |
protected | function | 6 | |
KernelTestBase:: |
public | function | @after | |
KernelTestBase:: |
protected | function | Dumps the current state of the virtual filesystem to STDOUT. | |
KernelTestBase:: |
public | function | BC: Automatically resolve former KernelTestBase class properties. | |
KernelTestBase:: |
public | function | Prevents serializing any properties. | |
PhpunitCompatibilityTrait:: |
public | function | Returns a mock object for the specified class using the available method. | |
PhpunitCompatibilityTrait:: |
public | function | Compatibility layer for PHPUnit 6 to support PHPUnit 4 code. | |
RandomGeneratorTrait:: |
protected | property | The random generator. | |
RandomGeneratorTrait:: |
protected | function | Gets the random generator for the utility methods. | |
RandomGeneratorTrait:: |
protected | function | Generates a unique random string containing letters and numbers. | 1 |
RandomGeneratorTrait:: |
public | function | Generates a random PHP object. | |
RandomGeneratorTrait:: |
public | function | Generates a pseudo-random string of ASCII characters of codes 32 to 126. | |
RandomGeneratorTrait:: |
public | function | Callback for random string validation. | |
StorageCopyTrait:: |
protected static | function | Copy the configuration from one storage to another and remove stale items. | |
TestRequirementsTrait:: |
private | function | Checks missing module requirements. | |
TestRequirementsTrait:: |
protected | function | Check module requirements for the Drupal use case. | 1 |
TestRequirementsTrait:: |
protected static | function | Returns the Drupal root directory. | |
ThemeInstallerTest:: |
public static | property |
Modules to enable. Overrides KernelTestBase:: |
|
ThemeInstallerTest:: |
protected | function | Returns the system.theme config object. | |
ThemeInstallerTest:: |
protected | function | Returns the ModuleHandler. | |
ThemeInstallerTest:: |
protected | function | Returns the ModuleInstaller. | |
ThemeInstallerTest:: |
public | function | Data provider for testInstallThemeWithUnmetModuleDependencies(). | |
ThemeInstallerTest:: |
public | function |
Registers test-specific services. Overrides KernelTestBase:: |
|
ThemeInstallerTest:: |
protected | function |
Overrides KernelTestBase:: |
|
ThemeInstallerTest:: |
public | function | Verifies that no themes are installed by default. | |
ThemeInstallerTest:: |
public | function | Tests installing a theme. | |
ThemeInstallerTest:: |
public | function | Tests installing a theme with a too long name. | |
ThemeInstallerTest:: |
public | function | Tests installing a non-existing theme. | |
ThemeInstallerTest:: |
public | function | Tests installing a sub-theme. | |
ThemeInstallerTest:: |
public | function | Tests installing a theme with module dependencies that are met. | |
ThemeInstallerTest:: |
public | function | Tests installing a theme with unmet module dependencies. | |
ThemeInstallerTest:: |
public | function | Tests that theme info can be altered by a module. | |
ThemeInstallerTest:: |
public | function | Tests uninstalling a theme. | |
ThemeInstallerTest:: |
public | function | Tests uninstalling the admin theme. | |
ThemeInstallerTest:: |
public | function | Tests uninstalling a base theme before its sub-theme. | |
ThemeInstallerTest:: |
public | function | Tests uninstalling the default theme. | |
ThemeInstallerTest:: |
public | function | Tests uninstalling a non-existing theme. | |
ThemeInstallerTest:: |
public | function | Tests uninstalling a theme that is not installed. | |
ThemeInstallerTest:: |
public | function | Tests uninstalling a sub-theme. | |
ThemeInstallerTest:: |
protected | function | Returns the theme handler service. | |
ThemeInstallerTest:: |
protected | function | Returns the theme installer service. |