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 <a href=''>Foo</a> test string"); }