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
TestSiteApplication class Drupal\TestSite core/tests/Drupal/TestSite/TestSiteApplication.php Application wrapper for test site commands. 1
TestSiteApplicationTest class Drupal\KernelTests\Scripts core/tests/Drupal/KernelTests/Scripts/TestSiteApplicationTest.php Tests core/scripts/test-site.php.
TestSiteClaroInstallTestScript class Drupal\TestSite core/tests/Drupal/TestSite/TestSiteClaroInstallTestScript.php Setup file used by TestSiteInstallTestScript.
TestSiteConfigurationExcluder class Drupal\Tests\package_manager\Kernel\PathExcluder core/modules/package_manager/tests/src/Kernel/PathExcluder/SiteConfigurationExcluderTest.php A test version of the site configuration excluder, to expose internals.
TestSiteExcluder final class Drupal\package_manager\PathExcluder core/modules/package_manager/src/PathExcluder/TestSiteExcluder.php Excludes 'sites/simpletest' from stage operations. 1
TestSiteExcluderTest class Drupal\Tests\package_manager\Kernel\PathExcluder core/modules/package_manager/tests/src/Kernel/PathExcluder/TestSiteExcluderTest.php Tests Site Excluder.
TestSiteInstallCommand class Drupal\TestSite\Commands core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php Command to create a test Drupal site. 1
TestSiteInstallTestScript class Drupal\TestSite core/tests/Drupal/TestSite/TestSiteInstallTestScript.php Setup file used by TestSiteApplicationTest.
TestSiteMultilingualInstallTestScript class Drupal\TestSite core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php Setup file used by TestSiteApplicationTest.
TestSiteOliveroInstallTestScript class Drupal\TestSite core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php Setup file used by TestSiteInstallTestScript.
TestSiteReleaseLocksCommand class Drupal\TestSite\Commands core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php Command to release all test site database prefix locks. 1
TestSiteTearDownCommand class Drupal\TestSite\Commands core/tests/Drupal/TestSite/Commands/TestSiteTearDownCommand.php Command to tear down a test Drupal site. 1
TestSiteUserLoginCommand class Drupal\TestSite\Commands core/tests/Drupal/TestSite/Commands/TestSiteUserLoginCommand.php Command to generate a login link for the test site. 1
TestSkipRowProcess class Drupal\migrate_prepare_row_test\Plugin\migrate\process core/modules/migrate/tests/modules/migrate_prepare_row_test/src/Plugin/migrate/process/TestSkipRowProcess.php Provides a testing process plugin that skips rows.
TestSourceWithAReallyLongName class Drupal\media_test_source\Plugin\media\Source core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestSourceWithAReallyLongName.php Provides test media source.
TestSqlBase class Drupal\Tests\migrate\Unit core/modules/migrate/tests/src/Unit/SqlBaseTest.php Creates a base source class for SQL migration testing.
TestSqlBase class Drupal\Tests\migrate\Kernel core/modules/migrate/tests/src/Kernel/SqlBaseTest.php A dummy source to help with testing SqlBase.
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

Other projects


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