mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-13 01:23:59 +02:00
Implement HTMLT tests, and migrate HTMLPurifierTest to this format.
HTMLT tests are a compact and easy-to-use way of making assertPurification type tests. They take the format of: --INI-- Ns.Directive = "directive value" --HTML-- Input HTML --EXPECT-- Expected HTML Expect more features and migration to be coming soon. Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
9
tests/HTMLPurifier/HTMLT/secure-munge.htmlt
Normal file
9
tests/HTMLPurifier/HTMLT/secure-munge.htmlt
Normal file
@@ -0,0 +1,9 @@
|
||||
--INI--
|
||||
URI.Munge = "/redirect.php?url=%s&check=%t"
|
||||
URI.MungeSecretKey = "foo"
|
||||
--HTML--
|
||||
<a href="http://localhost">foo</a>
|
||||
<img src="http://localhost" alt="local" />
|
||||
--EXPECT--
|
||||
<a href="/redirect.php?url=http%3A%2F%2Flocalhost&check=8e8223ae8fac24561104180ea549c21fbd111be7">foo</a>
|
||||
<img src="http://localhost" alt="local" />
|
Reference in New Issue
Block a user