world

"); $this->assert_equal("hello <p >world</p>", $safe_string); $this->assert_true($safe_string instanceof SafeString); } public function purify_test() { $safe_string = html::purify("hello

world

"); $expected = method_exists("purifier", "purify") ? "hello

world

" : "hello <p >world</p>"; $this->assert_equal($expected, $safe_string->unescaped()); $this->assert_true($safe_string instanceof SafeString); } public function mark_clean_test() { $safe_string = html::mark_clean("hello

world

"); $this->assert_true($safe_string instanceof SafeString); $safe_string_2 = html::clean($safe_string); $this->assert_equal("hello

world

", $safe_string_2); } public function js_string_test() { $string = html::js_string("hello's

world

"); $this->assert_equal('"hello\'s

world<\\/p>"', $string); } public function clean_attribute_test() { $safe_string = SafeString::of_safe_html("hello's

world

"); $safe_string = html::clean_attribute($safe_string); $this->assert_equal("hello's

world

", $safe_string); } }