Changeset 47122 for trunk/tests/phpunit/tests/term/wpGetObjectTerms.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/wpGetObjectTerms.php
r46586 r47122 19 19 $terms_1_slugs = array( 'foo', 'bar', 'baz' ); 20 20 21 // set the initial terms21 // Set the initial terms. 22 22 $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy ); 23 23 $this->assertEquals( 3, count( $tt_1 ) ); 24 24 25 // make sure they're correct25 // Make sure they're correct. 26 26 $terms = wp_get_object_terms( 27 27 $post_id, … … 898 898 public function filter_get_object_terms( $terms ) { 899 899 $term_ids = wp_list_pluck( $terms, 'term_id' ); 900 // all terms should still be objects900 // All terms should still be objects. 901 901 return $terms; 902 902 } … … 942 942 $set = wp_set_object_terms( $post_id, $terms, $taxonomy ); 943 943 944 // Filter for maintaining term order 944 // Filter for maintaining term order. 945 945 add_filter( 'wp_get_object_terms_args', array( $this, 'filter_wp_get_object_terms_args' ), 10, 3 ); 946 946 947 // Test directly 947 // Test directly. 948 948 $get_object_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'names' ) ); 949 949 $this->assertEquals( $terms, $get_object_terms ); 950 950 951 // Test metabox taxonomy (admin advanced edit) 951 // Test metabox taxonomy (admin advanced edit). 952 952 $terms_to_edit = get_terms_to_edit( $post_id, $taxonomy ); 953 953 $this->assertEquals( implode( ',', $terms ), $terms_to_edit );
Note: See TracChangeset
for help on using the changeset viewer.