WordPress.org

Make WordPress Core

Changeset 1295 in tests


Ignore:
Timestamp:
06/19/2013 10:16:56 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Test for string values in test_sanitize_ms_options(). see #23418.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/ms.php

    r1249 r1295  
    842842    /**
    843843     * @ticket 21552
     844     * @ticket 23418
    844845     */
    845846    function test_sanitize_ms_options() {
    846         update_option( 'illegal_names', array( '', 'Woo', '' ) );
    847         update_option( 'limited_email_domains', array(  'woo', '', 'boo.com', 'foo.net.biz..'  ) );
    848         update_option( 'banned_email_domains', array(  'woo', '', 'boo.com', 'foo.net.biz..'  ) );
    849 
    850         $this->assertEquals( array( 'Woo' ), get_option( 'illegal_names' ) );
    851         $this->assertEquals( array( 'woo', 'boo.com' ), get_option( 'limited_email_domains' ) );
    852         $this->assertEquals( array( 'woo', 'boo.com' ), get_option( 'banned_email_domains' ) );
     847        update_site_option( 'illegal_names', array( '', 'Woo', '' ) );
     848        update_site_option( 'limited_email_domains', array(  'woo', '', 'boo.com', 'foo.net.biz..'  ) );
     849        update_site_option( 'banned_email_domains', array(  'woo', '', 'boo.com', 'foo.net.biz..'  ) );
     850
     851        $this->assertEquals( array( 'Woo' ), get_site_option( 'illegal_names' ) );
     852        $this->assertEquals( array( 'woo', 'boo.com' ), get_site_option( 'limited_email_domains' ) );
     853        $this->assertEquals( array( 'woo', 'boo.com' ), get_site_option( 'banned_email_domains' ) );
     854
     855        update_site_option( 'illegal_names', 'foo bar' );
     856        update_site_option( 'limited_email_domains', "foo\nbar" );
     857        update_site_option( 'banned_email_domains', "foo\nbar" );
     858
     859        $this->assertEquals( array( 'foo', 'bar' ), get_site_option( 'illegal_names' ) );
     860        $this->assertEquals( array( 'foo', 'bar' ), get_site_option( 'limited_email_domains' ) );
     861        $this->assertEquals( array( 'foo', 'bar' ), get_site_option( 'banned_email_domains' ) );
    853862
    854863        foreach ( array( 'illegal_names', 'limited_email_domains', 'banned_email_domains' ) as $option ) {
    855             update_option( $option, array() );
    856             $this->assertSame( '', get_option( $option ) );
     864            update_site_option( $option, array() );
     865            $this->assertSame( '', get_site_option( $option ) );
    857866        }
    858867    }
Note: See TracChangeset for help on using the changeset viewer.