mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-05 07:44:01 +01:00
* fix "nonblock-statement-body-position" (fixed already) * fix "comma-dangle" * fix "no-regex-spaces" * fix "new-parens" * fix "object-curly-newline" * fix "object-property-newline" * fix "spaced-comment" semimanually * fix "no-constant-condition" manually * fix "unicorn/no-hex-escape" * fix "unicorn/escape-case" * fix "quote-props" * fix "no-whitespace-before-property" - fix bug/typo * fix "unicorn/empty-brace-spaces" * fix "keyword-spacing" * fix "dot-notation" * fix "no-return-assign" manually * fix "padding-line-between-statements" * fix "key-spacing" * fix "no-else-return" semimanually * fix some "no-undef" * fix case cs * Revert "fix "padding-line-between-statements"" * improve switch/case format I. * improve switch/case format II. regex: (^ *(break|return).*)\n *(\n) * fix safe "eqeqeq" * fix "radix" * fix v3.49.0 CS (static providers) * fix "string_implicit_backslashes" in php files * fix comments align * fix test static providers * fix stan * disable "final_internal_class" rule
42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
||
|
||
use PHPUnit\Framework\TestCase;
|
||
|
||
/**
|
||
* Test class to test rcube_spoofchecker class
|
||
*/
|
||
class Framework_Spoofchecker extends TestCase
|
||
{
|
||
/**
|
||
* Test data for test_check()
|
||
*/
|
||
public static function provide_check_cases(): iterable
|
||
{
|
||
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 provide_check_cases
|
||
*/
|
||
public function test_check($email, $expected)
|
||
{
|
||
$this->assertSame($expected, rcube_spoofchecker::check($email));
|
||
}
|
||
}
|