- Timestamp:
- 05/26/2025 02:34:12 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ajax/wpAjaxSendAttachmentToEditor.php
r55764 r60253 13 13 */ 14 14 class Tests_Ajax_wpAjaxSendAttachmentToEditor extends WP_Ajax_UnitTestCase { 15 16 /** 17 * Shared user ID for the tests. 18 * 19 * @var int 20 */ 21 public static $user_id = 0; 22 23 /** 24 * Set up shared fixtures. 25 * 26 * @param WP_UnitTest_Factory $factory 27 */ 28 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 29 self::$user_id = $factory->user->create( 30 array( 31 'role' => 'administrator', 32 'user_login' => 'user_36578_administrator', 33 'user_email' => 'user_36578_administrator@example.com', 34 ) 35 ); 36 } 15 37 16 38 /** … … 106 128 // Become an administrator. 107 129 $post = $_POST; 108 $user_id = self::factory()->user->create( 109 array( 110 'role' => 'administrator', 111 'user_login' => 'user_36578_administrator', 112 'user_email' => 'user_36578_administrator@example.com', 113 ) 114 ); 130 $user_id = self::$user_id; 115 131 wp_set_current_user( $user_id ); 116 132 $_POST = array_merge( $_POST, $post ); … … 152 168 // Become an administrator. 153 169 $post = $_POST; 154 $user_id = self::factory()->user->create( 155 array( 156 'role' => 'administrator', 157 'user_login' => 'user_36578_administrator', 158 'user_email' => 'user_36578_administrator@example.com', 159 ) 160 ); 170 $user_id = self::$user_id; 161 171 wp_set_current_user( $user_id ); 162 172 $_POST = array_merge( $_POST, $post );
Note: See TracChangeset
for help on using the changeset viewer.