| 238 | |
| 239 | function test_get() { |
| 240 | $user_id = $this->_make_user('author', 'test_wp_user_get', 'password', 'test@test.com'); |
| 241 | |
| 242 | $user = new WP_User( $user_id ); |
| 243 | $this->assertEquals( 'test_wp_user_get', $user->get( 'user_login' ) ); |
| 244 | $this->assertEquals( 'test@test.com', $user->get( 'user_email' ) ); |
| 245 | $this->assertEquals( 0, $user->get( 'use_ssl' ) ); |
| 246 | $this->assertEquals( '', $user->get( 'field_that_does_not_exist' ) ); |
| 247 | |
| 248 | update_user_meta( $user_id, 'dashed-key', 'abcdefg' ); |
| 249 | $this->assertEquals( 'abcdefg', $user->get( 'dashed-key' ) ); |
| 250 | } |
| 251 | |
| 252 | function test_is_set() { |
| 253 | $user_id = $this->_make_user('author', 'test_wp_user_is_set', 'password', 'test2@test.com'); |
| 254 | |
| 255 | $user = new WP_User( $user_id ); |
| 256 | $this->assertTrue( $user->is_set( 'user_email') ); |
| 257 | $this->assertTrue( $user->is_set( 'use_ssl' ) ); |
| 258 | $this->assertFalse( $user->is_set( 'field_that_does_not_exist' ) ); |
| 259 | |
| 260 | update_user_meta( $user_id, 'dashed-key', 'abcdefg' ); |
| 261 | $this->assertTrue( $user->is_set( 'dashed-key' ) ); |
| 262 | } |