Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F11543663
Spoofchecker.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
Spoofchecker.php
View Options
<?php
/**
* Test class to test rcube_spoofchecker class
*
* @package Tests
*/
class
Framework_Spoofchecker
extends
PHPUnit\Framework\TestCase
{
/**
* Test data for test_check()
*/
function
data_check
()
{
return
[
// Valid:
[
'test@paypal.com'
,
false
],
[
'postbаnk@gmail.com'
,
false
],
// ignore spoofed local part
[
'мон.мон'
,
false
],
// Suspicious:
[
'test@Рaypal.com'
,
true
],
[
'test@postbаnk.com'
,
true
],
[
'aaa.мон'
,
true
],
// TODO: Non-working as expected:
// ['test@paypa1.com', true],
// ['test@paypal' . "\xe2\x80\xa8" . '.com', true],
// ['test@paypal' . "\xe2\x80\x8b" . '.com', true],
// ['adoḅe.com', true], // ???????
];
}
/**
* @dataProvider data_check
*/
function
test_check
(
$email
,
$expected
)
{
$this
->
assertSame
(
$expected
,
rcube_spoofchecker
::
check
(
$email
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Sep 28, 10:46 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1429741
Default Alt Text
Spoofchecker.php (1 KB)
Attached To
Mode
R3 roundcubemail
Attached
Detach File
Event Timeline
Log In to Comment