escape() 공개 메소드

Escapes a string for output in an HTML document
public escape ( string $raw ) : string
$raw string
리턴 string
 public function testEscapeBrokenUtf8()
 {
     // The following includes an illegal utf-8 sequence to test.
     // Encoded in base64 to survive possible encoding changes of this file.
     $original = base64_decode('VGhpcyBpcyBhbiBpbGxlZ2FsIHV0Zi04IHNlcXVlbmNlOiDD');
     // Test that the escaped string is kinda similar in length, not empty
     $this->assertLessThan(10, abs(strlen($original) - strlen($this->helper->escape($original))));
 }
 /**
  * @covers Whoops\Util\TemplateHelper::escapeButPreserveUris
  * @covers Whoops\Util\TemplateHelper::escape
  */
 public function testEscape()
 {
     $original = "This is a <a href=''>Foo</a> test string";
     $this->assertEquals($this->helper->escape($original), "This is a &lt;a href=&#039;&#039;&gt;Foo&lt;/a&gt; test string");
 }