diff options
author | Tobias Sarnowski <sarnowski@cosmocode.de> | 2012-04-18 12:00:10 +0200 |
---|---|---|
committer | Tobias Sarnowski <sarnowski@cosmocode.de> | 2012-04-18 12:00:10 +0200 |
commit | d59108b91e9bf9fd56dc2e697cf31f9bbc7f9cd4 (patch) | |
tree | a982304293b7c4ce83bbd8b8ab551b63322e1f0d /_test/cases/inc/mail_isvalid.test.php | |
parent | 96199bdf84b54d92069ce0779aad324599c2542e (diff) | |
download | rpg-d59108b91e9bf9fd56dc2e697cf31f9bbc7f9cd4.tar.gz rpg-d59108b91e9bf9fd56dc2e697cf31f9bbc7f9cd4.tar.bz2 |
removed deprecated old test framework
Diffstat (limited to '_test/cases/inc/mail_isvalid.test.php')
-rw-r--r-- | _test/cases/inc/mail_isvalid.test.php | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/_test/cases/inc/mail_isvalid.test.php b/_test/cases/inc/mail_isvalid.test.php deleted file mode 100644 index 60f1e9353..000000000 --- a/_test/cases/inc/mail_isvalid.test.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php -// use no mbstring help here -require_once DOKU_INC.'inc/init.php'; - -class mail_isvalid extends UnitTestCase { - - - function test1(){ - $tests = array(); - - // our own tests - $tests[] = array('bugs@php.net',true); - $tests[] = array('~someone@somewhere.com',true); - $tests[] = array('no+body.here@somewhere.com.au',true); - $tests[] = array('username+tag@domain.com',true); // FS#1447 - $tests[] = array("rfc2822+allthesechars_#*!'`/-={}are.legal@somewhere.com.au",true); - $tests[] = array('_foo@test.com',true); // FS#1049 - $tests[] = array('bugs@php.net1',true); // new ICAN rulez seem to allow this - $tests[] = array('.bugs@php.net1',false); - $tests[] = array('bu..gs@php.net',false); - $tests[] = array('bugs@php..net',false); - $tests[] = array('bugs@.php.net',false); - $tests[] = array('bugs@php.net.',false); - $tests[] = array('bu(g)s@php.net1',false); - $tests[] = array('bu[g]s@php.net1',false); - $tests[] = array('somebody@somewhere.museum',true); - $tests[] = array('somebody@somewhere.travel',true); - $tests[] = array('root@[2010:fb:fdac::311:2101]',true); - $tests[] = array('test@example', true); // we allow local addresses - - // tests from http://code.google.com/p/php-email-address-validation/ below - - $tests[] = array('test@example.com', true); - $tests[] = array('TEST@example.com', true); - $tests[] = array('1234567890@example.com', true); - $tests[] = array('test+test@example.com', true); - $tests[] = array('test-test@example.com', true); - $tests[] = array('t*est@example.com', true); - $tests[] = array('+1~1+@example.com', true); - $tests[] = array('{_test_}@example.com', true); - $tests[] = array('"[[ test ]]"@example.com', true); - $tests[] = array('test.test@example.com', true); - $tests[] = array('test."test"@example.com', true); - $tests[] = array('"test@test"@example.com', true); - $tests[] = array('test@123.123.123.123', true); - $tests[] = array('test@[123.123.123.123]', true); - $tests[] = array('test@example.example.com', true); - $tests[] = array('test@example.example.example.com', true); - - $tests[] = array('test.example.com', false); - $tests[] = array('test.@example.com', false); - $tests[] = array('test..test@example.com', false); - $tests[] = array('.test@example.com', false); - $tests[] = array('test@test@example.com', false); - $tests[] = array('test@@example.com', false); - $tests[] = array('-- test --@example.com', false); // No spaces allowed in local part - $tests[] = array('[test]@example.com', false); // Square brackets only allowed within quotes - $tests[] = array('"test\test"@example.com', false); // Quotes cannot contain backslash - $tests[] = array('"test"test"@example.com', false); // Quotes cannot be nested - $tests[] = array('()[]\;:,<>@example.com', false); // Disallowed Characters - $tests[] = array('test@.', false); - $tests[] = array('test@example.', false); - $tests[] = array('test@.org', false); - $tests[] = array('12345678901234567890123456789012345678901234567890123456789012345@example.com', false); // 64 characters is maximum length for local part. This is 65. - $tests[] = array('test@123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012.com', false); // 255 characters is maximum length for domain. This is 256. - $tests[] = array('test@[123.123.123.123', false); - $tests[] = array('test@123.123.123.123]', false); - - - foreach($tests as $test){ - $info = 'Testing '.$test[0]; - $this->signal('failinfo',$info); - - if($test[1]){ - $this->assertTrue((bool) mail_isvalid($test[0])); - }else{ - $this->assertFalse((bool) mail_isvalid($test[0])); - } - } - } - -} -//Setup VIM: ex: et ts=4 : |