You are here

class TextWrapper in Drupal 8

Used by SafeMarkupTest to test that a class with a __toString() method works.

Hierarchy

Expanded class hierarchy of TextWrapper

File

core/tests/Drupal/Tests/Component/Utility/TextWrapper.php, line 8

Namespace

Drupal\Tests\Component\Utility
View source
class TextWrapper {

  /**
   * The text value.
   *
   * @var string
   */
  protected $text = '';

  /**
   * Constructs a \Drupal\Tests\Component\Utility\TextWrapper
   *
   * @param string $text
   */
  public function __construct($text) {
    $this->text = $text;
  }

  /**
   * Magic method
   *
   * @return string
   */
  public function __toString() {
    return $this->text;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TextWrapper::$text protected property The text value.
TextWrapper::__construct public function Constructs a \Drupal\Tests\Component\Utility\TextWrapper
TextWrapper::__toString public function Magic method