- Timestamp:
- 02/23/2016 06:13:30 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/selective-refresh.php
r36586 r36643 138 138 */ 139 139 function test_export_preview_data() { 140 $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); 141 wp_set_current_user( $user_id ); 142 $user = new WP_User( $user_id ); 143 do_action( 'customize_register', $this->wp_customize ); 144 $user->remove_cap( 'top_secret_clearance' ); 145 $this->wp_customize->add_setting( 'top_secret_message', array( 146 'capability' => 'top_secret_clearance', // The administrator role lacks this. 147 ) ); 140 148 $this->selective_refresh->add_partial( 'blogname', array( 141 149 'selector' => '#site-title', 150 ) ); 151 $this->selective_refresh->add_partial( 'top_secret_message', array( 152 'settings' => array( 'top_secret_message' ), 142 153 ) ); 143 154 ob_start(); … … 150 161 $this->assertInternalType( 'array', $exported_data['partials'] ); 151 162 $this->assertArrayHasKey( 'blogname', $exported_data['partials'] ); 163 $this->assertArrayNotHasKey( 'top_secret_message', $exported_data['partials'] ); 152 164 $this->assertEquals( '#site-title', $exported_data['partials']['blogname']['selector'] ); 153 165 $this->assertArrayHasKey( 'renderQueryVar', $exported_data );
Note: See TracChangeset
for help on using the changeset viewer.