Classes, traits, and interfaces - main - drupal
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
File
-
core/
core.api.php, line 1529
| Name | Deprecated | Object type | Namespace | File name | Summary | Direct uses | Use statements | Strings |
|---|---|---|---|---|---|---|---|---|
| Test2Interface | interface | Drupal\Tests\Component\Utility | core/ |
Provides a different test interface. | ||||
| TestableSqlContentEntityStorage | class | Drupal\KernelTests\Core\Entity\Sql | core/ |
A test subclass of SqlContentEntityStorage. | ||||
| TestAccessBlock | class | Drupal\block_test\Plugin\Block | core/ |
Provides a block to test access. | ||||
| TestAccessCheck | class | Drupal\router_test\Access | core/ |
Access check for test routes. | ||||
| TestAccessCheckInterface | interface | Drupal\Tests\Core\Access | core/ |
Defines an interface with a defined access() method for mocking. | ||||
| TestAccessClass | class | Drupal\Tests\Core\Render | core/ |
Test class for mocking the access callback. | ||||
| TestAction | class | Drupal\action_bulk_test\Plugin\Action | core/ |
Test action. | ||||
| TestActionConfirmForm | class | Drupal\action_bulk_test\Form | core/ |
Confirmation form for 'test_action' action. | 1 | |||
| TestAddForm | class | Drupal\media_library_form_overwrite_test\Form | core/ |
Test add form. | 2 | |||
| TestAjaxBlock | class | Drupal\layout_builder_test\Plugin\Block | core/ |
Provides a 'TestAjax' block. | ||||
| TestAnnotation | class | Drupal\Tests\Component\Annotation\Plugin\Discovery | core/ |
|||||
| TestAttribute | class | Drupal\Tests\Component\Plugin\Discovery | core/ |
|||||
| TestAttribute | class | Drupal\Tests\Core\Template | core/ |
Test class for HTML attributes collector, sanitizer, and renderer. | ||||
| TestAttributes | class | Drupal\router_test\Controller | core/ |
Test controller for method-level Route attributes. | 1 | |||
| TestAttributesBlock | class | Drupal\layout_builder_test\Plugin\Block | core/ |
Provides a 'TestAttributes' block. | ||||
| TestAuth | class | Drupal\rest_test\Authentication\Provider | core/ |
Authentication provider for testing purposes. | 2 | |||
| TestAuthenticationProvider | class | Drupal\Tests\Core\Authentication | core/ |
A simple provider for unit testing AuthenticationCollector. | ||||
| TestAuthenticationProviderInterface | interface | Drupal\Tests\Core\Authentication | core/ |
Helper interface to mock two interfaces at once. | ||||
| TestAuthGlobal | class | Drupal\rest_test\Authentication\Provider | core/ |
Global authentication provider for testing purposes. | 2 | |||
| TestBaseFieldDefinitionInterface | interface | Drupal\Tests\Core\Field | core/ |
Defines a test interface to mock entity base field definitions. | 3 | |||
| TestBaseInterface | interface | Drupal\Tests\Component\ProxyBuilder | core/ |
Test base interface. | 1 | |||
| TestBaseThemeHooks | class | Drupal\test_base_theme\Hook | core/ |
Hook implementations for test_base_theme. | ||||
| TestBlockInstantiation | class | Drupal\block_test\Plugin\Block | core/ |
Provides a basic block for testing block instantiation and configuration. | 1 | |||
| TestBlockPluginWithRefinableDependentAccessInterface | interface | Drupal\Tests\layout_builder\Unit | core/ |
Test interface for dependent access block plugins. | ||||
| TestCacheableDependency | class | Drupal\Tests\Core\Render | core/ |
Cacheable dependency object for use in tests. | 2 | |||
| TestCacheBlock | class | Drupal\block_test\Plugin\Block | core/ |
Provides a block to test caching. | ||||
| TestCacheOptionalBlock | class | Drupal\block_test\Plugin\Block | core/ |
Provides a block implementing CacheOptionalInterface to test its caching. | ||||
| TestCallables | class | Drupal\Tests\Core\Render | core/ |
Mock callable for testing the pre_render callback. | ||||
| TestChildInterface | interface | Drupal\Tests\Component\ProxyBuilder | core/ |
Test child interface. | 1 | |||
| TestClass | class | Drupal\Tests\Core\Plugin | core/ |
Stub class for testing PluginWithFormsTrait. | ||||
| TestClass | class | Drupal\Tests\Component\Utility | core/ |
Provides a test class. | ||||
| TestClass | class | Drupal\Tests\layout_builder\Unit | core/ |
Test class using the trait. | ||||
| TestClass | class | Drupal\service_provider_test | core/ |
Handles kernel events for request and response. | 2 | |||
| TestClassAttribute | class | Drupal\router_test\Controller | core/ |
Test controller for class-level Route attribute with method-level merging. | 1 | |||
| TestClassClassMetadata | final class | Drupal\PHPStan\Rules | core/ |
Rules class-level PHPUnit test metadata in test classes. | 1 | |||
| TestClassClassMetadataTest | class | Drupal\PHPStan\Tests | core/ |
Tests TestClassClassMetadata rule. | ||||
| TestClassMethodMetadata | final class | Drupal\PHPStan\Rules | core/ |
Validates method-level PHPUnit test metadata in test classes. | 1 | |||
| TestClassMethodMetadataTest | class | Drupal\PHPStan\Tests | core/ |
Tests TestClassMethodMetadata rule. | ||||
| TestClosureHttpMiddlewareClass | class | Drupal\Tests\Core\DependencyInjection\Fixture | core/ |
Stub of http_middleware class taking a service closure for the inner kernel. | 1 | |||
| TestCompatClosureHttpMiddlewareClass | class | Drupal\Tests\Core\DependencyInjection\Fixture | core/ |
Stub of http_middleware class taking a service closure with bc. | 1 | |||
| TestCompatibilityTrait | trait | Drupal\TestTools\PhpUnitCompatibility\PhpUnit11 | core/ |
Drupal's forward compatibility layer with multiple versions of PHPUnit. | ||||
| TestCompatibilityTrait | trait | Drupal\TestTools\PhpUnitCompatibility\PhpUnit12 | core/ |
Drupal's forward compatibility layer with multiple versions of PHPUnit. | 1 | |||
| TestConcat | class | Drupal\Tests\migrate\Unit\process | core/ |
Mock class for the concat process plugin. | ||||
| TestConditionAccessResolverTrait | class | Drupal\Tests\Core\Condition | core/ |
Stub class for testing trait. | ||||
| TestConfigEntityWithPluginCollections | class | Drupal\Tests\Core\Config\Entity | core/ |
Stub class for testing. | ||||
| TestConfigFactoryOverrideBase | class | Drupal\Tests\Core\Config | core/ |
Stub class for testing ConfigFactoryOverrideBase. | ||||
| TestConfigNamesMapper | class | Drupal\Tests\config_translation\Unit | core/ |
Defines a test mapper class. | ||||
| TestConfigType | class | Drupal\module_installer_config_test\Entity | core/ |
Defines a configuration-based entity type used for testing. | ||||
| TestConfigurableContextAwarePluginInterface | interface | Drupal\Tests\Core\Plugin | core/ |
Test interface used for creating mock classes in tests. | ||||
| TestConfigurablePlugin | class | Drupal\Tests\Core\Plugin\Fixtures | core/ |
A configurable plugin implementation used for testing. | 3 |
Pagination
- Previous page
- Page 189
- Next page
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.