diff --git a/app/tests/Framadate/Services/InputServiceUnitTest.php b/app/tests/Framadate/Services/InputServiceUnitTest.php new file mode 100644 index 0000000..cbbb36d --- /dev/null +++ b/app/tests/Framadate/Services/InputServiceUnitTest.php @@ -0,0 +1,41 @@ +filterMail($email); + + $this->assertSame($expected, $filtered); + + } + + + function liste_emails() + { + + return [ + // valids addresses + "valid address" => ["example@example.com", "example@example.com"], + "local address" => ["test@localhost", "test@localhost"], + "IP address" => ["ip.email@127.0.0.1", "ip.email@127.0.0.1"], + "with spaces arround" => [" with@spaces ", "with@spaces"], + "unicode caracters" => ["unicode.éà@idn-œ.com", "unicode.éà@idn-œ.com"], + // invalids addresses + "without domain" => ["without-domain", FALSE], + "space inside" => ["example @example.com", FALSE], + "forbidden chars" => ["special_chars.)#@example.com", FALSE], + ]; + + } + +}