class TextWrapper
Used by SafeMarkupTest to test that a class with a __toString() method works.
Hierarchy
- class \Drupal\Tests\Component\Utility\TextWrapper
Expanded class hierarchy of TextWrapper
File
- 
              core/tests/ Drupal/ Tests/ Component/ Utility/ TextWrapper.php, line 8 
Namespace
Drupal\Tests\Component\UtilityView 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
| Title Sort descending | Modifiers | Object type | Summary | 
|---|---|---|---|
| TextWrapper::$text | protected | property | The text value. | 
| TextWrapper::__construct | public | function | Constructs a \Drupal\Tests\Component\Utility\TextWrapper | 
| TextWrapper::__toString | public | function | Magic method | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
