Version 1
[yaffs-website] / web / core / tests / Drupal / Tests / Component / Utility / TextWrapper.php
1 <?php
2
3 namespace Drupal\Tests\Component\Utility;
4
5 /**
6  * Used by SafeMarkupTest to test that a class with a __toString() method works.
7  */
8 class TextWrapper {
9
10   /**
11    * The text value.
12    *
13    * @var string
14    */
15   protected $text = '';
16
17   /**
18    * Constructs a \Drupal\Tests\Component\Utility\TextWrapper
19    *
20    * @param string $text
21    */
22   public function __construct($text) {
23     $this->text = $text;
24   }
25
26   /**
27    * Magic method
28    *
29    * @return string
30    */
31   public function __toString() {
32     return $this->text;
33   }
34
35 }