WordPress.org

Make WordPress Core

Ticket #21570: 21570-ut2.diff

File 21570-ut2.diff, 786 bytes (added by mdawaffe, 6 years ago)
  • tests/ms.php

     
    420420                $this->assertEquals( $post_id2, $post->ID );
    421421                restore_current_blog();
    422422        }
     423
     424        /**
     425         * @ticket 21570
     426         */
     427        function test_is_email_address_unsafe() {
     428                update_site_option( 'banned_email_domains', 'bar.com' );
     429
     430                foreach ( array( 'test@bar.com', 'test@foo.bar.com' ) as $email_address ) {
     431                        $this->assertTrue( is_email_address_unsafe( $email_address ), "$email_address should be UNSAFE" );
     432                }
     433
     434                foreach ( array( 'test@foobar.com', 'test@foo-bar.com' ) as $email_address ) {
     435                        $this->assertFalse( is_email_address_unsafe( $email_address ), "$email_address should be SAFE" );
     436                }
     437        }
    423438}
    424439
    425440endif;