| | 382 | |
| | 383 | /** |
| | 384 | * @ticket 34010 |
| | 385 | */ |
| | 386 | public function test_get_post_types_by_support_single_feature() { |
| | 387 | $this->assertContains( 'post', get_post_types_by_support( 'title' ) ); |
| | 388 | $this->assertContains( 'page', get_post_types_by_support( 'title' ) ); |
| | 389 | $this->assertContains( 'attachment', get_post_types_by_support( 'title' ) ); |
| | 390 | $this->assertContains( 'nav_menu_item', get_post_types_by_support( 'title' ) ); |
| | 391 | } |
| | 392 | |
| | 393 | /** |
| | 394 | * @ticket 34010 |
| | 395 | */ |
| | 396 | public function test_get_post_types_by_support_multiple_features() { |
| | 397 | $this->assertContains( 'post', get_post_types_by_support( array( 'thumbnail', 'author' ) ) ); |
| | 398 | $this->assertContains( 'page', get_post_types_by_support( array( 'thumbnail', 'author' ) ) ); |
| | 399 | } |
| | 400 | |
| | 401 | /** |
| | 402 | * @ticket 34010 |
| | 403 | */ |
| | 404 | public function test_get_post_types_by_support_or_operator() { |
| | 405 | $this->assertContains( 'post', get_post_types_by_support( array( 'post-formats', 'page-attributes' ), 'or' ) ); |
| | 406 | $this->assertContains( 'page', get_post_types_by_support( array( 'post-formats', 'page-attributes' ), 'or' ) ); |
| | 407 | } |
| | 408 | |
| | 409 | /** |
| | 410 | * @ticket 34010 |
| | 411 | */ |
| | 412 | public function test_get_post_types_by_support_not_operator() { |
| | 413 | $this->assertContains( 'attachment', get_post_types_by_support( array( 'thumbnail' ), 'not' ) ); |
| | 414 | $this->assertContains( 'revision', get_post_types_by_support( array( 'thumbnail' ), 'not' ) ); |
| | 415 | $this->assertContains( 'nav_menu_item', get_post_types_by_support( array( 'thumbnail' ), 'not' ) ); |
| | 416 | } |
| | 417 | |
| | 418 | /** |
| | 419 | * @ticket 34010 |
| | 420 | */ |
| | 421 | public function test_get_post_types_by_support_excluding_features() { |
| | 422 | $this->assertEqualSets( array(), get_post_types_by_support( array( 'post-formats', 'page-attributes' ) ) ); |
| | 423 | } |
| | 424 | |
| | 425 | /** |
| | 426 | * @ticket 34010 |
| | 427 | */ |
| | 428 | public function test_get_post_types_by_support_non_existant_feature() { |
| | 429 | $this->assertEqualSets( array(), get_post_types_by_support( 'somefeature' ) ); |
| | 430 | } |