Changeset 48663 for trunk/tests/phpunit/tests/term/getTerms.php
- Timestamp:
- 07/28/2020 02:21:54 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/getTerms.php
r47122 r48663 721 721 722 722 /** 723 * @ticket 46768 724 */ 725 function test_get_terms_child_of_fields_id_name() { 726 $parent = self::factory()->category->create(); 727 $child = self::factory()->category->create( 728 array( 729 'parent' => $parent, 730 'slug' => 'test-1', 731 'name' => 'Test 1', 732 ) 733 ); 734 $child2 = self::factory()->category->create( 735 array( 736 'parent' => $parent, 737 'slug' => 'test-2', 738 'name' => 'Test 2', 739 ) 740 ); 741 742 $terms = get_terms( 743 'category', 744 array( 745 'child_of' => $parent, 746 'hide_empty' => false, 747 'fields' => 'id=>name', 748 ) 749 ); 750 751 $this->assertEquals( 752 array( 753 $child => 'Test 1', 754 $child2 => 'Test 2', 755 ), 756 $terms 757 ); 758 759 } 760 761 /** 762 * @ticket 46768 763 */ 764 function test_get_terms_child_of_fields_id_slug() { 765 $parent = self::factory()->category->create(); 766 $child = self::factory()->category->create( 767 array( 768 'parent' => $parent, 769 'slug' => 'test-1', 770 'name' => 'Test 1', 771 ) 772 ); 773 $child2 = self::factory()->category->create( 774 array( 775 'parent' => $parent, 776 'slug' => 'test-2', 777 'name' => 'Test 2', 778 ) 779 ); 780 781 $terms = get_terms( 782 'category', 783 array( 784 'child_of' => $parent, 785 'hide_empty' => false, 786 'fields' => 'id=>slug', 787 ) 788 ); 789 790 $this->assertEquals( 791 array( 792 $child => 'test-1', 793 $child2 => 'test-2', 794 ), 795 $terms 796 ); 797 } 798 799 /** 723 800 * @ticket 31118 724 801 */
Note: See TracChangeset
for help on using the changeset viewer.