Changeset 35249 for trunk/tests/phpunit/tests/customize/section.php
- Timestamp:
- 10/17/2015 09:28:43 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/section.php
r35242 r35249 7 7 */ 8 8 class Tests_WP_Customize_Section extends WP_UnitTestCase { 9 protected static $admin_id; 10 protected static $user_ids = array(); 11 12 public static function wpSetUpBeforeClass( $factory ) { 13 self::$user_ids[] = self::$admin_id = $factory->user->create( array( 'role' => 'administrator' ) ); 14 } 15 16 public static function wpTearDownAfterClass() { 17 foreach ( self::$user_ids as $id ) { 18 self::delete_user( $id ); 19 } 20 } 9 21 10 22 /** … … 136 148 */ 137 149 function test_check_capabilities() { 138 $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); 139 wp_set_current_user( $user_id ); 150 wp_set_current_user( self::$admin_id ); 140 151 141 152 $section = new WP_Customize_Section( $this->manager, 'foo' ); … … 162 173 */ 163 174 function test_maybe_render() { 164 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'administrator' ) ));175 wp_set_current_user( self::$admin_id ); 165 176 $section = new WP_Customize_Section( $this->manager, 'bar' ); 166 177 $customize_render_section_count = did_action( 'customize_render_section' ); … … 187 198 */ 188 199 function test_print_templates_standard() { 189 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'administrator' ) ));200 wp_set_current_user( self::$admin_id ); 190 201 191 202 $section = new WP_Customize_Section( $this->manager, 'baz' ); … … 202 213 */ 203 214 function test_print_templates_custom() { 204 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'administrator' ) ));215 wp_set_current_user( self::$admin_id ); 205 216 206 217 $section = new Custom_Section_Test( $this->manager, 'baz' );
Note: See TracChangeset
for help on using the changeset viewer.