Ticket #15706: 15706.3.unit-tests.patch
File 15706.3.unit-tests.patch, 2.7 KB (added by , 12 years ago) |
---|
-
tests/ms.php
525 525 526 526 /** 527 527 * Test fetching a blog that doesn't exist and again after it exists. 528 * 528 * 529 529 * @ticket 23405 530 530 */ 531 531 function test_get_blog_details_blog_does_not_exist() { … … 828 828 * @ticket 21570 829 829 */ 830 830 function test_is_email_address_unsafe() { 831 update_site_option( 'banned_email_domains', array( 'bar.com', 'foo.co' ) );831 update_site_option( 'banned_email_domains', array( 'bar.com', 'foo.co', '*.foo.org', 'foo.*.gov' ) ); 832 832 833 foreach ( array( 'test@bar.com', 'test@foo.bar.com', 'test@foo.co', 'test@subdomain.foo.co' ) as $email_address ) {833 foreach ( array( 'test@bar.com', 'test@foo.bar.com', 'test@foo.co', 'test@subdomain.foo.co', 'test@bar.foo.org', 'test@foo.bar.gov' ) as $email_address ) { 834 834 $this->assertTrue( is_email_address_unsafe( $email_address ), "$email_address should be UNSAFE" ); 835 835 } 836 836 837 foreach ( array( 'test@foobar.com', 'test@foo-bar.com', 'test@foo.com', 'test@subdomain.foo.com' ) as $email_address ) {837 foreach ( array( 'test@foobar.com', 'test@foo-bar.com', 'test@foo.com', 'test@subdomain.foo.com', 'test@bar.baz.foo.org', 'test@foo.bar.baz.gov' ) as $email_address ) { 838 838 $this->assertFalse( is_email_address_unsafe( $email_address ), "$email_address should be SAFE" ); 839 839 } 840 840 } 841 841 842 function test_is_email_address_allowed() { 843 update_site_option( 'limited_email_domains', array( 'bar.com', 'foo.co', '*.foo.org', 'foo.*.gov' ) ); 844 845 foreach ( array( 'test@bar.com', 'test@foo.bar.com', 'test@foo.co', 'test@subdomain.foo.co', 'test@bar.foo.org', 'test@foo.bar.gov' ) as $email_address ) { 846 $this->assertTrue( is_email_address_allowed( $email_address ), "$email_address should be UNSAFE" ); 847 } 848 849 foreach ( array( 'test@foobar.com', 'test@foo-bar.com', 'test@foo.com', 'test@subdomain.foo.com', 'test@bar.baz.foo.org', 'test@foo.bar.baz.gov' ) as $email_address ) { 850 $this->assertFalse( is_email_address_allowed( $email_address ), "$email_address should be SAFE" ); 851 } 852 853 update_site_option( 'limited_email_domains', '' ); 854 855 foreach ( array( 'test@foobar.com', 'test@foo-bar.com', 'test@foo.com', 'test@subdomain.foo.com', 'test@bar.baz.foo.org', 'test@foo.bar.baz.gov' ) as $email_address ) { 856 $this->assertTrue( is_email_address_allowed( $email_address ), "$email_address should be SAFE" ); 857 } 858 } 859 842 860 /** 843 861 * @ticket 21552 844 862 * @ticket 23418 … … 998 1016 'user_login' => $spam_username, 999 1017 ) ); 1000 1018 update_user_status( $spam_user_id, 'spam', '1' ); 1001 1019 1002 1020 $this->assertTrue( is_user_spammy( $spam_username ) ); 1003 1021 $this->assertFalse( is_user_spammy( 'testuser1' ) ); 1004 1022 }