Classes, traits, and interfaces in Drupal 9
Primary tabs
Introduction to classes
A lot of the PHP code in Drupal is object oriented (OO), making use of PHP classes, interfaces, and traits. See the Objected-oriented programming conventions for more information.
See also
Objected-oriented programming conventions
|
Name |
Type | Namespace | Location | Description | Direct uses | Use statements | Strings |
|---|---|---|---|---|---|---|---|
| TestPerComponentEntityFormDisplay | class |
Drupal\ |
core/ |
||||
| TestPermissionCallbacks | class |
Drupal\ |
core/ |
||||
| TestPhpMailFailure | class |
Drupal\ |
core/ |
Defines a mail sending implementation that always fails. | 1 | ||
| TestPluginBase | class |
Drupal\ |
core/ |
Helper class for using the PluginBase abstract class. | |||
| TestPluginDefinition | class |
Drupal\ |
core/ |
||||
| TestPluginDependency | class |
Drupal\ |
core/ |
||||
| TestPluginForm | class |
Drupal\ |
core/ |
||||
| TestPluginManager | class |
Drupal\ |
core/ |
Defines a plugin manager used by Plugin API unit tests. | 1 | ||
| TestPluginManager | class |
Drupal\ |
core/ |
A plugin manager for condition plugins. | 1 | ||
| TestPluginManagerWithDefaults | class |
Drupal\ |
core/ |
||||
| TestPluginSettingsBase | class |
Drupal\ |
core/ |
||||
| TestPreinstallInterface | interface |
Drupal\ |
core/ |
Allows running code prior to a test site install. | 1 | 1 | |
| TestPrepareLayout | class |
Drupal\ |
core/ |
An event subscriber to test altering section storage via the \Drupal\layout_builder\Event\PrepareLayoutEvent. | 2 | ||
| TestProcessor | class |
Drupal\ |
core/ |
Defines a default processor implementation. | |||
| TestRequirementsTrait | trait |
Drupal\ |
core/ |
Allows test classes to require Drupal modules as dependencies. | 1 | ||
| TestRouteProvider | class |
Drupal\ |
core/ |
||||
| TestRouteProvider | class |
Drupal\ |
core/ |
Provides a test entity route provider. | |||
| TestRouterInterface | interface |
Drupal\ |
core/ |
Provides a router interface that also can match requests. | |||
| TestRouteSubscriber | class |
Drupal\ |
core/ |
Provides a test route subscriber. | |||
| TestRunnerKernel | class |
Drupal\ |
core/ |
Kernel for run-tests.sh. | 2 | ||
| TestRunnerKernelTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Test\TestRunnerKernel @runTestsInSeparateProcesses @preserveGlobalState disabled @group Test @group simpletest | |||
| TestSearchPage | class |
Drupal\ |
core/ |
||||
| TestSectionList | class |
Drupal\ |
core/ |
||||
| TestSelection | class |
Drupal\ |
core/ |
Test EntityReferenceSelection with conditions on the 'reusable' field. | 1 | ||
| TestService | class |
Drupal\ |
core/ |
1 | |||
| TestServiceComplexMethod | class |
Drupal\ |
core/ |
||||
| TestServiceComplexMethod | class |
Drupal\ |
core/ |
||||
| TestServiceMethodReturnsVoid | class |
Drupal\ |
core/ |
||||
| TestServiceMethodWithParameter | class |
Drupal\ |
core/ |
||||
| TestServiceNoMethod | class |
Drupal\ |
core/ |
||||
| TestServiceNoMethod | class |
Drupal\ |
core/ |
||||
| TestServiceNullableTypehintSelf | class |
Drupal\ |
core/ |
||||
| TestServiceReturnReference | class |
Drupal\ |
core/ |
||||
| TestServiceSimpleMethod | class |
Drupal\ |
core/ |
||||
| TestServiceWithChildInterfaces | class |
Drupal\ |
core/ |
||||
| TestServiceWithInterface | class |
Drupal\ |
core/ |
||||
| TestServiceWithProtectedMethods | class |
Drupal\ |
core/ |
||||
| TestServiceWithPublicStaticMethod | class |
Drupal\ |
core/ |
||||
| TestSessionBag | class |
Drupal\ |
core/ |
Test session container. | 1 | 2 | |
| TestSessionHandlerProxy | class |
Drupal\ |
core/ |
Provides a test session handler proxy. | 3 | ||
| TestSettingSummariesContentType | class |
Drupal\ |
core/ |
Tests the JavaScript updating of summaries on content type form. | |||
| TestSettingsValidationBlock | class |
Drupal\ |
core/ |
Provides a test settings validation block. | |||
| TestSetupInterface | interface |
Drupal\ |
core/ |
Allows setting up an environment as part of a test site install. | 3 | 1 | |
| TestSetupTrait | trait |
Drupal\ |
core/ |
Provides a trait for shared test setup functionality. | 3 | ||
| TestSetupTraitTest | class |
Drupal\ |
core/ |
Tests the TestSetupTrait trait. | |||
| TestSiteApplication | class |
Drupal\ |
core/ |
Application wrapper for test site commands. | 1 | ||
| TestSiteApplicationTest | class |
Drupal\ |
core/ |
Tests core/scripts/test-site.php. | |||
| TestSiteInstallCommand | class |
Drupal\ |
core/ |
Command to create a test Drupal site. | 1 | ||
| TestSiteInstallTestScript | class |
Drupal\ |
core/ |
Setup file used by TestSiteApplicationTest. | |||
| TestSiteMultilingualInstallTestScript | class |
Drupal\ |
core/ |
Setup file used by TestSiteApplicationTest. |