34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
<?php
|
|
|
|
class common_obfuscate_test extends DokuWikiTest {
|
|
|
|
function test_none(){
|
|
global $conf;
|
|
$conf['mailguard'] = 'none';
|
|
$this->assertEquals('jon-doe@example.com', obfuscate('jon-doe@example.com'));
|
|
}
|
|
|
|
function test_hex(){
|
|
global $conf;
|
|
$conf['mailguard'] = 'hex';
|
|
$this->assertEquals('jon-doe@example.com',
|
|
obfuscate('jon-doe@example.com'));
|
|
}
|
|
|
|
function test_hex_utf32(){
|
|
global $conf;
|
|
$conf['mailguard'] = 'hex';
|
|
$this->assertEquals('user@example.com?subject=Привет',
|
|
obfuscate('user@example.com?subject=Привет'));
|
|
}
|
|
|
|
function test_visible(){
|
|
global $conf;
|
|
$conf['mailguard'] = 'visible';
|
|
$this->assertEquals('jon [dash] doe [at] example [dot] com', obfuscate('jon-doe@example.com'));
|
|
}
|
|
|
|
|
|
}
|
|
//Setup VIM: ex: et ts=4 :
|