Changeset 54161 for trunk/tests/phpunit/tests/general/feedLinksExtra.php
- Timestamp:
- 09/14/2022 05:12:20 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/general/feedLinksExtra.php
r53125 r54161 580 580 $this->assertNotEmpty( get_echo( 'feed_links_extra' ) ); 581 581 } 582 583 /** 584 * @dataProvider data_feed_links_extra_should_output_nothing_when_filters_return_false 585 * 586 * @ticket 55904 587 * 588 * @param string $type The name of the test class property containing the object ID. 589 * @param string $filter The name of the filter to set to false. 590 */ 591 public function test_feed_links_extra_should_output_nothing_when_filters_return_false( $type, $filter ) { 592 $permalink = $this->helper_get_the_permalink( $type ); 593 $this->go_to( $permalink ); 594 595 add_filter( $filter, '__return_false' ); 596 597 $this->assertEmpty( get_echo( 'feed_links_extra' ) ); 598 } 599 600 /** 601 * Data provider. 602 * 603 * @return array 604 */ 605 public function data_feed_links_extra_should_output_nothing_when_filters_return_false() { 606 return array( 607 'a post with a comment' => array( 608 'type' => 'post_with_comment', 609 'filter' => 'feed_links_extra_show_post_comments_feed', 610 ), 611 'a custom post type' => array( 612 'type' => 'post_type', 613 'filter' => 'feed_links_extra_show_post_type_archive_feed', 614 ), 615 'a category' => array( 616 'type' => 'category', 617 'filter' => 'feed_links_extra_show_category_feed', 618 ), 619 'a tag' => array( 620 'type' => 'tag', 621 'filter' => 'feed_links_extra_show_tag_feed', 622 ), 623 'a taxonomy' => array( 624 'type' => 'tax', 625 'filter' => 'feed_links_extra_show_tax_feed', 626 ), 627 'an author' => array( 628 'type' => 'author', 629 'filter' => 'feed_links_extra_show_author_feed', 630 ), 631 'search results' => array( 632 'type' => 'search', 633 'filter' => 'feed_links_extra_show_search_feed', 634 ), 635 ); 636 } 582 637 }
Note: See TracChangeset
for help on using the changeset viewer.