WordPress.org

Make WordPress Core

Ticket #25046: 25046-tests.diff

File 25046-tests.diff, 1.3 KB (added by jkudish, 7 years ago)

Adding some tests to go along with the fix

  • tests/ms.php

     
    826826
    827827        /**
    828828         * @ticket 21570
     829         * @ticket 25046
    829830         */
    830831        function test_is_email_address_unsafe() {
    831                 update_site_option( 'banned_email_domains', array( 'bar.com', 'foo.co' ) );
     832                update_site_option( 'banned_email_domains', array( 'bar.com', 'foo.co', 'barfoo.com' ) );
    832833
    833                 foreach ( array( 'test@bar.com', 'test@foo.bar.com', 'test@foo.co', 'test@subdomain.foo.co' ) as $email_address ) {
     834                foreach ( array( 'test@bar.com', 'test@foo.bar.com', 'test@foo.co', 'test@subdomain.foo.co', 'test@Bar.com', 'tEst@bar.com', 'test@barFoo.com', 'tEst@foo.bar.com' ) as $email_address ) {
    834835                        $this->assertTrue( is_email_address_unsafe( $email_address ), "$email_address should be UNSAFE" );
    835836                }
    836837
    837                 foreach ( array( 'test@foobar.com', 'test@foo-bar.com', 'test@foo.com', 'test@subdomain.foo.com' ) as $email_address ) {
     838                foreach ( array( 'test@foobar.com', 'test@foo-bar.com', 'test@foo.com', 'test@subdomain.foo.com', 'test@Foobar.com', 'test@Foo-bar.com', 'tEst@foobar.com' ) as $email_address ) {
    838839                        $this->assertFalse( is_email_address_unsafe( $email_address ), "$email_address should be SAFE" );
    839840                }
    840841        }