TestTrait.php

Same filename in other branches
  1. 8.9.x core/modules/system/tests/src/Traits/TestTrait.php
  2. 10 core/modules/system/tests/src/Traits/TestTrait.php
  3. 11.x core/modules/system/tests/src/Traits/TestTrait.php

Namespace

Drupal\Tests\system\Traits

File

core/modules/system/tests/src/Traits/TestTrait.php

View source
<?php

namespace Drupal\Tests\system\Traits;


/**
 * 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.
 *
 * @see \Drupal\Tests\system\Unit\TraitAccessTest
 */
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;
    }

}

Traits

Title Deprecated Summary
TestTrait A nothing trait, but declared in the Drupal\Tests namespace.

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