xref: /dokuwiki/_test/tests/inc/common_obfuscate.test.php (revision e86f6b02caa7933ce6a8a2358ceb43ed6a3eccff)
1<?php
2
3class common_obfuscate_test extends DokuWikiTest {
4
5    function test_none(){
6        global $conf;
7        $conf['mailguard'] = 'none';
8        $this->assertEquals(obfuscate('jon-doe@example.com'), 'jon-doe@example.com');
9    }
10
11    function test_hex(){
12        global $conf;
13        $conf['mailguard'] = 'hex';
14        $this->assertEquals(obfuscate('jon-doe@example.com'),
15        '&#x6a;&#x6f;&#x6e;&#x2d;&#x64;&#x6f;&#x65;&#x40;&#x65;&#x78;&#x61;&#x6d;&#x70;&#x6c;&#x65;&#x2e;&#x63;&#x6f;&#x6d;');
16    }
17
18    function test_visible(){
19        global $conf;
20        $conf['mailguard'] = 'visible';
21        $this->assertEquals(obfuscate('jon-doe@example.com'), 'jon [dash] doe [at] example [dot] com');
22    }
23
24
25}
26//Setup VIM: ex: et ts=4 :
27