diff --git a/tests/phpunit/tests/user.php b/tests/phpunit/tests/user.php
index 71acceb..419e8c3 100644
|
a
|
b
|
class Tests_User extends WP_UnitTestCase { |
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | | /** |
| 149 | | * Test the magic __unset method |
| 150 | | * |
| 151 | | * @ticket 20043 |
| 152 | | */ |
| 153 | | public function test_user_unset() { |
| 154 | | // New user |
| 155 | | $user_id = $this->factory->user->create( array( 'role' => 'author' ) ); |
| 156 | | $user = new WP_User( $user_id ); |
| 157 | | |
| 158 | | // Test custom fields |
| 159 | | $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_unset |
| 168 | | * @expectedDeprecated WP_User->id |
| 169 | | * @ticket 20043 |
| 170 | | */ |
| 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_id |
| 179 | | * @ticket 20043 |
| 180 | | */ |
| 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() { |
| 190 | 150 | global $wpdb; |