WordPress.org

Make WordPress Core

Changeset 1046 in tests


Ignore:
Timestamp:
09/25/2012 01:44:59 AM (8 years ago)
Author:
nacin
Message:

Tests for some multisite options being sanitized in sanitize_option(). (illegal_names, limited_email_domains, banned_email_domains). props wonderboymusic. see #WP21552.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/ms.php

    r1045 r1046  
    481481        }
    482482    }
     483
     484    /**
     485     * @ticket 21552
     486     */
     487    function test_sanitize_ms_options() {
     488        update_option( 'illegal_names', array( '', 'Woo', '' ) );
     489        update_option( 'limited_email_domains', array(  'woo', '', 'boo.com', 'foo.net.biz..'  ) );
     490        update_option( 'banned_email_domains', array(  'woo', '', 'boo.com', 'foo.net.biz..'  ) );
     491
     492        $this->assertEquals( array( 'Woo' ), get_option( 'illegal_names' ) );
     493        $this->assertEquals( array( 'woo', 'boo.com' ), get_option( 'limited_email_domains' ) );
     494        $this->assertEquals( array( 'woo', 'boo.com' ), get_option( 'banned_email_domains' ) );
     495
     496        foreach ( array( 'illegal_names', 'limited_email_domains', 'banned_email_domains' ) as $option ) {
     497            update_option( $option, array() );
     498            $this->assertSame( '', get_option( $option ) );
     499        }
     500    }
    483501}
    484502
Note: See TracChangeset for help on using the changeset viewer.