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("helloworld
"); $this->assert_equal("helloworld
", $safe_string); $this->assert_true($safe_string instanceof SafeString); } public function mark_safe_test() { $safe_string = html::mark_safe("helloworld
"); $this->assert_true($safe_string instanceof SafeString); $safe_string_2 = html::clean($safe_string); $this->assert_equal("helloworld
", $safe_string_2); } public function escape_for_js_test() { $string = html::escape_for_js("hello'sworld
"); $this->assert_equal("hello\\'sworld<\\/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'sworld
", $safe_string); } }