WordPress.org

Make WordPress Core

Ticket #21552: sanitize-ms-options-test.diff

File sanitize-ms-options-test.diff, 855 bytes (added by wonderboymusic, 6 years ago)
  • tests/ms.php

     
    480480                        $this->assertFalse( is_email_address_unsafe( $email_address ), "$email_address should be SAFE" );
    481481                }
    482482        }
     483       
     484        function test_sanitize_ms_options() {
     485                update_option( 'illegal_names', array( '', 'Woo', '' ) );
     486                update_option( 'limited_email_domains', array(  'woo', '', 'boo.com', 'foo.net.biz..'  ) );
     487                update_option( 'banned_email_domains', array(  'woo', '', 'boo.com', 'foo.net.biz..'  ) );
     488               
     489                $this->assertTrue( array( 'Woo' ) == get_option( 'illegal_names' ) );
     490                $this->assertTrue( array( 'woo', 'boo.com' ) == get_option( 'limited_email_domains' ) );
     491                $this->assertTrue( array( 'woo', 'boo.com' ) == get_option( 'banned_email_domains' ) );
     492        }
    483493}
    484494
    485495endif;