forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'w24_MDL-39096_m25_obfuscate' of git://github.com/skodak…
…/moodle into MOODLE_25_STABLE
- Loading branch information
Showing
2 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,6 +106,22 @@ function test_format_text_email() { | |
format_text_email('習習',FORMAT_HTML)); | ||
} | ||
|
||
function test_obfuscate_email() { | ||
$email = '[email protected]'; | ||
$obfuscated = obfuscate_email($email); | ||
$this->assertNotSame($email, $obfuscated); | ||
$back = textlib::entities_to_utf8(urldecode($email), true); | ||
$this->assertSame($email, $back); | ||
} | ||
|
||
function test_obfuscate_text() { | ||
$text = 'Žluťoučký koníček 32131'; | ||
$obfuscated = obfuscate_text($text); | ||
$this->assertNotSame($text, $obfuscated); | ||
$back = textlib::entities_to_utf8($obfuscated, true); | ||
$this->assertSame($text, $back); | ||
} | ||
|
||
function test_highlight() { | ||
$this->assertEquals(highlight('good', 'This is good'), 'This is <span class="highlight">good</span>'); | ||
$this->assertEquals(highlight('SpaN', 'span'), '<span class="highlight">span</span>'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters