Classes, traits, and interfaces - 10.3.x - drupal

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

File

core/core.api.php, line 1518

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
TestContextAwareNoValidContextOptionsBlock class Drupal\block_test\Plugin\Block core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareNoValidContextOptionsBlock.php Provides a context-aware block that uses a not-passed, non-required context.
TestContextAwarePlugin class Drupal\KernelTests\Core\Plugin core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php Provides a test implementation of a context-aware plugin.
TestContextAwarePlugin class Drupal\KernelTests\Core\Plugin\Context core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php
TestContextAwarePluginDefinition class Drupal\KernelTests\Core\Plugin\Context core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php
TestContextAwareUnsatisfiedBlock class Drupal\block_test\Plugin\Block core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareUnsatisfiedBlock.php Provides a context-aware block.
TestContextualLink class Drupal\menu_test\Plugin\Menu\ContextualLink core/modules/system/tests/modules/menu_test/src/Plugin/Menu/ContextualLink/TestContextualLink.php Defines a contextual link plugin with a dynamic title from user input. 1
TestController class Drupal\token_test\Controller core/modules/system/tests/modules/token_test/src/Controller/TestController.php Provides a test controller for token replacement.
TestController class Drupal\container_rebuild_test core/modules/system/tests/modules/container_rebuild_test/src/TestController.php
TestController class Drupal\dialog_renderer_test\Controller core/modules/system/tests/modules/dialog_renderer_test/src/Controller/TestController.php Test controller display modal links and content.
TestController class Drupal\off_canvas_test\Controller core/modules/system/tests/modules/off_canvas_test/src/Controller/TestController.php Test controller for 2 different responses.
TestController class Drupal\csrf_test\Controller core/modules/system/tests/modules/csrf_test/src/Controller/TestController.php Just a test controller for test routes.
TestController class Drupal\js_webassert_test\Controller core/modules/system/tests/modules/js_webassert_test/src/Controller/TestController.php
TestController class Drupal\csrf_race_test\Controller core/modules/system/tests/modules/csrf_race_test/src/Controller/TestController.php Controller to test concurrent CSRF token generation.
TestController class Drupal\contextual_test\Controller core/modules/contextual/tests/modules/contextual_test/src/Controller/TestController.php Test controller to provide a callback for the contextual link.
TestController class Drupal\views_test_modal\Controller core/modules/views/tests/modules/views_test_modal/src/Controller/TestController.php
TestController class Drupal\Tests\Core\Controller core/tests/Drupal/Tests/Core/Controller/TestController.php Defines a test controller used by unit tests.
TestController class Drupal\Tests\Core\Access core/tests/Drupal/Tests/Core/Access/CustomAccessCheckTest.php
TestController class Drupal\path_changed_helper_test\Controller core/modules/system/tests/modules/path_changed_helper_test/src/Controller/TestController.php Controller for testing the PathChangedHelper class.
TestController class Drupal\content_negotiation_test\Controller core/modules/system/tests/modules/content_negotiation_test/src/Controller/TestController.php Test controller for content negotiation tests.
TestController class Drupal\http_kernel_test\Controller core/modules/system/tests/modules/http_kernel_test/src/Controller/TestController.php A test controller.
TestController class Drupal\Tests\views\Unit\Plugin\display core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php A page controller for use by tests in this file.
TestControllers class Drupal\paramconverter_test core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php Controller routine for testing the paramconverter.
TestControllers class Drupal\menu_test core/modules/system/tests/modules/menu_test/src/TestControllers.php Controllers for testing the menu integration routing system.
TestControllers class Drupal\router_test core/modules/system/tests/modules/router_test_directory/src/TestControllers.php Controller routines for testing the routing system. 1
TestCoverageTest class Drupal\Tests\jsonapi\Kernel core/modules/jsonapi/tests/src/Kernel/TestCoverageTest.php Checks that all core content/config entity types have JSON:API test coverage.
TestDatabase class Drupal\Core\Test core/lib/Drupal/Core/Test/TestDatabase.php Provides helper methods for interacting with the fixture database. 1 10
TestDatabaseTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php @coversDefaultClass \Drupal\Core\Test\TestDatabase[[api-linebreak]]
TestDataType class Drupal\Tests\Core\Plugin\Fixtures\Plugin\DataType core/tests/Drupal/Tests/Core/Plugin/Fixtures/Plugin/DataType/TestDataType.php Provides a test data type.
TestDataTypeDeriver class Drupal\Tests\Core\Plugin\Fixtures\Plugin\DataType core/tests/Drupal/Tests/Core/Plugin/Fixtures/Plugin/DataType/TestDataTypeDeriver.php Provides a deriver that returns a plugin for the bare ID and one variant.
TestDefaultExceptionSubscriber class Drupal\Tests\Core\EventSubscriber core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php
TestDefaultHtmlRouteProvider class Drupal\Tests\Core\Entity\Routing core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
TestDefaultTableMapping class Drupal\Tests\Core\Entity\Sql core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php Extends DefaultTableMapping to allow calling its protected methods.
TestDerivativeDiscovery class Drupal\Tests\Core\Plugin\Discovery core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscovery.php Defines test derivative discovery. 1
TestDerivativeDiscoveryWithObject class Drupal\Tests\Core\Plugin\Discovery core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php Defines test derivative discovery using an object..
TestDifferentDisplays class Drupal\media_test_source\Plugin\media\Source core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestDifferentDisplays.php Provides test media source.
TestDiscovery class Drupal\Core\Test core/lib/Drupal/Core/Test/TestDiscovery.php Discovers available tests. 2
TestDiscoveryTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php @coversDefaultClass \Drupal\Core\Test\TestDiscovery[[api-linebreak]] @group Test
TestDisplayVariant class Drupal\display_variant_test\Plugin\DisplayVariant core/modules/system/tests/modules/display_variant_test/src/Plugin/DisplayVariant/TestDisplayVariant.php Provides a display variant that requires configuration.
TestDomainObject class Drupal\early_rendering_controller_test core/modules/system/tests/modules/early_rendering_controller_test/src/TestDomainObject.php 2
TestDomainObjectViewSubscriber class Drupal\early_rendering_controller_test core/modules/system/tests/modules/early_rendering_controller_test/src/TestDomainObjectViewSubscriber.php View subscriber for turning TestDomainObject objects into Response objects. 2
TestDrupal6SqlBase class Drupal\Tests\migrate_drupal\Unit\source\d6 core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php Extends the Drupal6SqlBase abstract class.
TestDrupalSqlBase class Drupal\Tests\migrate_drupal\Unit\source core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php Extends the DrupalSqlBase abstract class.
TestElementInfoManager class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php Provides a test custom element plugin.
TestEntity class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php A concrete entity.
TestEntity class Drupal\Tests\content_moderation\Unit core/modules/content_moderation/tests/src/Unit/ContentModerationRouteSubscriberTest.php A concrete entity.
TestEntityFieldManager class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php
TestEntityForm class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php Provides a test entity form. 1
TestEntityFormInjected class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php Provides a test entity form that uses injection.
TestEntityHandlerBase abstract class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php Provides a test entity handler.
TestEntityListBuilder class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php

Other projects


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