summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-10-22 00:34:34 +0200
committerAndreas Gohr <andi@splitbrain.org>2005-10-22 00:34:34 +0200
commit776b36ecb82abfa13cfae70762b30c5f81499555 (patch)
tree1fd3db8a4dc0f2358904ce9c9b3a425d745512e7 /_test
parent42905504e134d999710eacf73253844e85cf6fec (diff)
downloadrpg-776b36ecb82abfa13cfae70762b30c5f81499555.tar.gz
rpg-776b36ecb82abfa13cfae70762b30c5f81499555.tar.bz2
fix for double encoding when using mailguard
darcs-hash:20051021223434-7ad00-b6364357c2cc0af50bfdd1490debbb198d3ee5a6.gz
Diffstat (limited to '_test')
-rw-r--r--_test/cases/inc/common_obfuscate.test.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/_test/cases/inc/common_obfuscate.test.php b/_test/cases/inc/common_obfuscate.test.php
new file mode 100644
index 000000000..60042ac19
--- /dev/null
+++ b/_test/cases/inc/common_obfuscate.test.php
@@ -0,0 +1,29 @@
+<?php
+
+require_once DOKU_INC.'inc/common.php';
+
+class common_obfuscate_test extends UnitTestCase {
+
+ function test_none(){
+ global $conf;
+ $conf['mailguard'] = 'none';
+ $this->assertEqual(obfuscate('jon-doe@example.com'), 'jon-doe@example.com');
+ }
+
+ function test_hex(){
+ global $conf;
+ $conf['mailguard'] = 'hex';
+print obfuscate('andi@foobar.com');
+ $this->assertEqual(obfuscate('jon-doe@example.com'),
+ '&#x6a;&#x6f;&#x6e;&#x2d;&#x64;&#x6f;&#x65;&#x40;&#x65;&#x78;&#x61;&#x6d;&#x70;&#x6c;&#x65;&#x2e;&#x63;&#x6f;&#x6d;');
+ }
+
+ function test_visible(){
+ global $conf;
+ $conf['mailguard'] = 'visible';
+ $this->assertEqual(obfuscate('jon-doe@example.com'), 'jon [dash] doe [at] example [dot] com');
+ }
+
+
+}
+//Setup VIM: ex: et ts=4 enc=utf-8 :