Changeset 30513
- Timestamp:
- 11/22/2014 03:36:00 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user.php
r30430 r30513 146 146 } 147 147 148 /**149 * Test the magic __unset method150 *151 * @ticket 20043152 */153 public function test_user_unset() {154 // New user155 $user_id = $this->factory->user->create( array( 'role' => 'author' ) );156 $user = new WP_User( $user_id );157 158 // Test custom fields159 $user->customField = 123;160 $this->assertEquals( $user->customField, 123 );161 unset( $user->customField );162 $this->assertFalse( isset( $user->customField ) );163 return $user;164 }165 166 /**167 * @depends test_user_unset168 * @expectedDeprecated WP_User->id169 * @ticket 20043170 */171 function test_user_unset_lowercase_id( $user ) {172 // Test 'id' (lowercase)173 unset( $user->id );174 return $user;175 }176 177 /**178 * @depends test_user_unset_lowercase_id179 * @ticket 20043180 */181 function test_user_unset_uppercase_id( $user ) {182 // Test 'ID'183 $this->assertNotEmpty( $user->ID );184 unset( $user->ID );185 $this->assertEmpty( $user->ID );186 }187 188 148 // Test meta property magic functions for property get/set/isset. 189 149 function test_user_meta_properties() {
Note: See TracChangeset
for help on using the changeset viewer.