Classes, traits, and interfaces - main - 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 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
TestSqlContentDefaultTableMapping class Drupal\Tests\Core\Entity\Sql core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php Extends DefaultTableMapping to allow calling its protected methods.
TestSqlIdMap class Drupal\Tests\migrate\Unit core/modules/migrate/tests/src/Unit/TestSqlIdMap.php Defines a SQL ID map for use in tests. 1 1
TestSqlPrepareQuery class Drupal\migrate_sql_prepare_query_test\Plugin\migrate\source core/modules/migrate/tests/modules/migrate_sql_prepare_query_test/src/Plugin/migrate/source/TestSqlPrepareQuery.php Source plugin for prepare query test.
TestStateBasedSectionStorage class Drupal\layout_builder_test\Plugin\SectionStorage core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/TestStateBasedSectionStorage.php Provides a test section storage that is controlled by state.
TestStatementInterface interface Drupal\Tests\views\Unit\Plugin\pager core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php Creates StatementInterface for testing.
TestStaticMethodClass class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php Provides a class for testing a static method.
TestStatus class Drupal\Core\Test core/lib/Drupal/Core/Test/TestStatus.php Consolidates test result status information. 1
TestStorage class Drupal\Tests\Core\Config core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php Provides a test implementation of \Drupal\Core\Config\StorageInterface.
TestSubscriber class Drupal\package_manager_test_validation\EventSubscriber core/modules/package_manager/tests/modules/package_manager_test_validation/src/EventSubscriber/TestSubscriber.php Defines an event subscriber for testing validation of Package Manager events. 2 2
TestSubsubthemeHooks class Drupal\test_subsubtheme\Hook core/modules/system/tests/themes/test_subsubtheme/src/Hook/TestSubsubthemeHooks.php Hook implementations for test_subsubtheme.
TestSubthemeHooks class Drupal\test_subtheme\Hook core/modules/system/tests/themes/test_subtheme/src/Hook/TestSubthemeHooks.php Hook implementations for test_subtheme.
TestSuiteBaseTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/TestSuiteBaseTest.php Tests Suite Base.
TestSystemLoggerChannel final class Drupal\advisory_feed_test core/modules/system/tests/modules/advisory_feed_test/src/TestSystemLoggerChannel.php Provides a decorator for the 'logger.channel.system' service for testing. 2
TestTasksSettingsSub1 class Drupal\menu_test\Plugin\Menu\LocalTask core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalTask/TestTasksSettingsSub1.php Defines a local task plugin with a dynamic title. 1
TestTaskWithUserInput class Drupal\menu_test\Plugin\Menu\LocalTask core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalTask/TestTaskWithUserInput.php Mock for testing JavaScript in local tasks title. 1
TestTestDatabase class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php Stub class supports TestDatabaseTest::testConstructorNullPrefix().
TestTextfieldWidget class Drupal\field_plugins_test\Plugin\Field\FieldWidget core/modules/field/tests/modules/field_plugins_test/src/Plugin/Field/FieldWidget/TestTextfieldWidget.php Plugin implementation of the 'field_plugins_test_text_widget' widget.
TestTextTrimmedFormatter class Drupal\field_plugins_test\Plugin\Field\FieldFormatter core/modules/field/tests/modules/field_plugins_test/src/Plugin/Field/FieldFormatter/TestTextTrimmedFormatter.php Plugin implementation of the 'field_plugins_test_text_formatter' formatter.
TestThemeAlterHooks class Drupal\test_theme_alter\Hook core/modules/system/tests/themes/test_theme_alter/src/Hook/TestThemeAlterHooks.php Hook implementations for test_theme_alter.
TestThemeExtensionList class Drupal\Tests\Core\Extension core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php Test theme extension list class.
TestThemeHooks class Drupal\test_theme\Hook core/modules/system/tests/themes/test_theme/src/Hook/TestThemeHooks.php Hook implementations for test_theme.
TestThemeNegotiator class Drupal\menu_test\Theme core/modules/system/tests/modules/menu_test/src/Theme/TestThemeNegotiator.php Tests the theme negotiation functionality. 2
TestThemeNyanCatEngineHooks class Drupal\test_theme_nyan_cat_engine\Hook core/modules/system/tests/themes/test_theme_nyan_cat_engine/src/Hook/TestThemeNyanCatEngineHooks.php Hook implementations for test_theme_nyan_cat_engine.
TestThemeThemeHooks class Drupal\test_theme_theme\Hook core/modules/system/tests/themes/test_theme_theme/src/Hook/TestThemeThemeHooks.php Hook implementations for test_theme_theme.
TestTime class Drupal\update_test\Datetime core/modules/update/tests/modules/update_test/src/Datetime/TestTime.php Test service for altering the request time. 2
TestTime class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/StageConflictTest.php A test-only implementation of the time service.
TestTime class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspacePublisherTest.php A test-only implementation of the time service.
TestToolkit class Drupal\image_test\Plugin\ImageToolkit core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php Defines a Test toolkit for image manipulation within Drupal. 2
TestTrait trait Drupal\Tests\system\Traits core/modules/system/tests/src/Traits/TestTrait.php A nothing trait, but declared in the Drupal\Tests namespace. 1
TestTranslation class Drupal\media_test_source\Plugin\media\Source core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestTranslation.php Provides test media source.
TestTranslationManager class Drupal\Tests\Core\StringTranslation core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php A chained translation implementation used for testing.
TestTranslationManager class Drupal\Tests\user\Unit core/modules/user/tests/src/Unit/PermissionHandlerTest.php Implements a translation manager in tests.
TestType class Drupal\workflow_type_test\Plugin\WorkflowType core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/TestType.php Test workflow type. 4
TestUrl class Drupal\Tests\Core core/tests/Drupal/Tests/Core/UrlTest.php URL information holder with overridden access manager for testing.
TestValidatedReferenceConstraint class Drupal\entity_test\Plugin\Validation\Constraint core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/TestValidatedReferenceConstraint.php Validates referenced entities.
TestValidatedReferenceConstraintValidator class Drupal\entity_test\Plugin\Validation\Constraint core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/TestValidatedReferenceConstraintValidator.php Validates referenced entities.
TestViewListBuilder class Drupal\Tests\views_ui\Unit core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php Stub class for testing ViewListBuilder methods.
TestViewsLocalTask class Drupal\Tests\views\Unit\Plugin\Derivative core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php Replaces the applicable views call for easier testability.
TestViewsTest class Drupal\Tests\views\Kernel core/modules/views/tests/src/Kernel/TestViewsTest.php Tests that test views provided by all modules match schema.
TestWaitTerminateMiddleware class Drupal\Core\Test\StackMiddleware core/lib/Drupal/Core/Test/StackMiddleware/TestWaitTerminateMiddleware.php Acquire a lock to signal request termination to the test runner.
TestWithConstraints class Drupal\media_test_source\Plugin\media\Source core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestWithConstraints.php Provides generic media type.
TestWithHiddenSourceField class Drupal\media_test_source\Plugin\media\Source core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestWithHiddenSourceField.php Provides test media source.
TestWorkspaceNegotiator class Drupal\workspace_update_test\Negotiator core/modules/workspaces/tests/modules/workspace_update_test/src/Negotiator/TestWorkspaceNegotiator.php Defines a workspace negotiator used for testing. 2
TestWorkspaceProvider class Drupal\workspaces_test\Provider core/modules/workspaces/tests/modules/workspaces_test/src/Provider/TestWorkspaceProvider.php Defines a test workspace provider.
TestYamlRouteDiscovery class Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php Extends the core route builder with a setter method for the YAML discovery.
Text class Drupal\views\Plugin\views\area core/modules/views/src/Plugin/views/area/Text.php Views area text handler.
Textarea class Drupal\config_translation\FormElement core/modules/config_translation/src/FormElement/Textarea.php Defines the textarea element for the configuration translation interface.
Textarea class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Textarea.php Provides a form element for input of multiple-line text. 1
TextareaTest class Drupal\Tests\Core\Render\Element core/tests/Drupal/Tests/Core/Render/Element/TextareaTest.php Tests Drupal\Core\Render\Element\Textarea.
TextareaTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/TextareaTest.php Tests the form API textarea element.

Other projects


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