trait TestTrait in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/tests/src/Traits/TestTrait.php \Drupal\Tests\system\Traits\TestTrait
A nothing trait, but declared in the Drupal\Tests namespace.
We use this trait to test autoloading of traits outside of the normal test suite namespaces.
Hierarchy
- trait \Drupal\Tests\system\Traits\TestTrait
See also
\Drupal\Tests\system\Unit\TraitAccessTest
1 file declares its use of TestTrait
- TraitAccessTest.php in core/
modules/ system/ tests/ src/ Unit/ TraitAccessTest.php
File
- core/
modules/ system/ tests/ src/ Traits/ TestTrait.php, line 13
Namespace
Drupal\Tests\system\TraitsView source
trait TestTrait {
/**
* Random string for a not very interesting trait.
*
* @var string
*/
protected $stuff = 'stuff';
/**
* Return a test string to a trait user.
*
* @return string
* Just a random sort of string.
*/
protected function getStuff() {
return $this->stuff;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TestTrait:: |
protected | property | Random string for a not very interesting trait. | |
TestTrait:: |
protected | function | Return a test string to a trait user. |