Changeset 49004 for trunk/tests/phpunit/tests/user/slashes.php
- Timestamp:
- 09/19/2020 10:53:15 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/slashes.php
r49003 r49004 49 49 $_POST = add_magic_quotes( $_POST ); // The add_user() function will strip slashes. 50 50 51 $ id= add_user();52 $user = get_user_to_edit( $id );51 $user_id = add_user(); 52 $user = get_user_to_edit( $user_id ); 53 53 54 54 $this->assertSame( $this->slash_1, $user->first_name ); … … 74 74 $_POST = add_magic_quotes( $_POST ); // The add_user() function will strip slashes. 75 75 76 $ id= add_user();77 $user = get_user_to_edit( $id );76 $user_id = add_user(); 77 $user = get_user_to_edit( $user_id ); 78 78 79 79 $this->assertSame( $this->slash_2, $user->first_name ); … … 88 88 */ 89 89 function test_edit_user() { 90 $ id = self::factory()->user->create();90 $user_id = self::factory()->user->create(); 91 91 92 92 $_POST = array(); … … 103 103 $_POST = add_magic_quotes( $_POST ); // The edit_user() function will strip slashes. 104 104 105 $ id = edit_user( $id );106 $user = get_user_to_edit( $id );105 $user_id = edit_user( $user_id ); 106 $user = get_user_to_edit( $user_id ); 107 107 108 108 $this->assertSame( $this->slash_1, $user->first_name ); … … 125 125 $_POST = add_magic_quotes( $_POST ); // The edit_user() function will strip slashes. 126 126 127 $ id = edit_user( $id );128 $user = get_user_to_edit( $id );127 $user_id = edit_user( $user_id ); 128 $user = get_user_to_edit( $user_id ); 129 129 130 130 $this->assertSame( $this->slash_2, $user->first_name ); … … 139 139 */ 140 140 function test_wp_insert_user() { 141 $ id= wp_insert_user(141 $user_id = wp_insert_user( 142 142 array( 143 143 'user_login' => 'slash_example_user_3', … … 152 152 ) 153 153 ); 154 $user = get_user_to_edit( $id );154 $user = get_user_to_edit( $user_id ); 155 155 156 156 $this->assertSame( wp_unslash( $this->slash_1 ), $user->first_name ); … … 160 160 $this->assertSame( wp_unslash( $this->slash_3 ), $user->description ); 161 161 162 $ id= wp_insert_user(162 $user_id = wp_insert_user( 163 163 array( 164 164 'user_login' => 'slash_example_user_4', … … 173 173 ) 174 174 ); 175 $user = get_user_to_edit( $id );175 $user = get_user_to_edit( $user_id ); 176 176 177 177 $this->assertSame( wp_unslash( $this->slash_2 ), $user->first_name ); … … 186 186 */ 187 187 function test_wp_update_user() { 188 $ id= self::factory()->user->create();189 $ id= wp_update_user(190 array( 191 'ID' => $ id,188 $user_id = self::factory()->user->create(); 189 $user_id = wp_update_user( 190 array( 191 'ID' => $user_id, 192 192 'role' => 'subscriber', 193 193 'first_name' => $this->slash_1, … … 198 198 ) 199 199 ); 200 $user = get_user_to_edit( $id );200 $user = get_user_to_edit( $user_id ); 201 201 202 202 $this->assertSame( wp_unslash( $this->slash_1 ), $user->first_name ); … … 206 206 $this->assertSame( wp_unslash( $this->slash_3 ), $user->description ); 207 207 208 $ id= wp_update_user(209 array( 210 'ID' => $ id,208 $user_id = wp_update_user( 209 array( 210 'ID' => $user_id, 211 211 'role' => 'subscriber', 212 212 'first_name' => $this->slash_2, … … 217 217 ) 218 218 ); 219 $user = get_user_to_edit( $id );219 $user = get_user_to_edit( $user_id ); 220 220 221 221 $this->assertSame( wp_unslash( $this->slash_2 ), $user->first_name );
Note: See TracChangeset
for help on using the changeset viewer.