| 430 | |
| 431 | /** |
| 432 | * @ticket 39120 |
| 433 | */ |
| 434 | function test_get_and_set() { |
| 435 | |
| 436 | $terms = new WP_Term_Query; |
| 437 | |
| 438 | $this->assertNull( $terms->get( 'fields' ) ); |
| 439 | $this->assertNull( $terms->query_vars['fields'] ); |
| 440 | |
| 441 | $terms->set( 'fields', 'ids' ); |
| 442 | $this->assertSame( 'ids', $terms->get( 'fields' ) ); |
| 443 | $this->assertSame( 'ids', $terms->query_vars['fields'] ); |
| 444 | |
| 445 | $terms->set( 'fields', '' ); |
| 446 | $this->assertSame( '', $terms->get( 'fields' ) ); |
| 447 | $this->assertSame( '', $terms->query_vars['fields'] ); |
| 448 | |
| 449 | $this->assertNull( $terms->get( 'does-not-exist' ) ); |
| 450 | $this->assertSame( 'foo', $terms->get( 'does-not-exist', 'foo' ) ); |
| 451 | } |
| 452 | |
| 453 | |