WordPress.org

Make WordPress Core

Changeset 39017


Ignore:
Timestamp:
10/30/2016 02:03:05 PM (3 years ago)
Author:
johnbillion
Message:

Customize: Correct the CRUD tests for custom CSS on multisite.

See #35395

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/customize/custom-css-setting.php

    r38858 r39017  
    3131        parent::setUp();
    3232        require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
    33         wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
     33
     34        $user_id = self::factory()->user->create( array(
     35            'role' => 'administrator',
     36        ) );
     37        if ( is_multisite() ) {
     38            grant_super_admin( $user_id );
     39        }
     40
     41        wp_set_current_user( $user_id );
    3442
    3543        global $wp_customize;
     
    116124        $updated_css = 'body { color: blue; }';
    117125        $this->wp_customize->set_post_value( $this->setting->id, $updated_css );
    118         $this->setting->save();
     126        $saved = $this->setting->save();
     127
     128        $this->assertNotFalse( $saved );
    119129        $this->assertEquals( $updated_css, $this->setting->value() );
    120130        $this->assertEquals( $updated_css, wp_get_custom_css( $this->setting->stylesheet ) );
Note: See TracChangeset for help on using the changeset viewer.