Changeset 51367 for trunk/tests/phpunit/tests/term.php
- Timestamp:
- 07/07/2021 10:32:56 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term.php
r51331 r51367 102 102 103 103 $tt = wp_add_object_terms( $posts[0], $tags[1], 'post_tag' ); 104 $this->assert Same( 1, count( $tt ));104 $this->assertCount( 1, $tt ); 105 105 $this->assertSame( array( $tags[1] ), wp_get_object_terms( $posts[0], 'post_tag', array( 'fields' => 'ids' ) ) ); 106 106 107 107 $three_tags = array( $tags[0], $tags[1], $tags[2] ); 108 108 $tt = wp_add_object_terms( $posts[1], $three_tags, 'post_tag' ); 109 $this->assert Same( 3, count( $tt ));109 $this->assertCount( 3, $tt ); 110 110 $this->assertSame( $three_tags, wp_get_object_terms( $posts[1], 'post_tag', array( 'fields' => 'ids' ) ) ); 111 111 … … 114 114 $this->assertInstanceOf( 'WP_Error', wp_remove_object_terms( $posts[0], $tags[1], 'non_existing_taxonomy' ) ); 115 115 $this->assertTrue( wp_remove_object_terms( $posts[1], $three_tags, 'post_tag' ) ); 116 $this->assert Same( 0, count( wp_get_object_terms( $posts[1], 'post_tag' )) );116 $this->assertCount( 0, wp_get_object_terms( $posts[1], 'post_tag' ) ); 117 117 118 118 foreach ( $tags as $term_id ) { … … 178 178 179 179 $this->assertIsArray( $post->post_category ); 180 $this->assert Same( 1, count( $post->post_category ));180 $this->assertCount( 1, $post->post_category ); 181 181 $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] ); 182 182 … … 186 186 187 187 wp_set_post_categories( $post_id, array( $term1['term_id'], $term2['term_id'] ) ); 188 $this->assert Same( 2, count( $post->post_category ));188 $this->assertCount( 2, $post->post_category ); 189 189 $this->assertSame( array( $term2['term_id'], $term1['term_id'] ), $post->post_category ); 190 190 … … 201 201 202 202 wp_set_post_categories( $post_id, array(), true ); 203 $this->assert Same( 1, count( $post->post_category ));203 $this->assertCount( 1, $post->post_category ); 204 204 $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] ); 205 205 206 206 wp_set_post_categories( $post_id, array() ); 207 $this->assert Same( 1, count( $post->post_category ));207 $this->assertCount( 1, $post->post_category ); 208 208 $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] ); 209 209 }
Note: See TracChangeset
for help on using the changeset viewer.