Changeset 51367 for trunk/tests/phpunit/tests/post/objects.php
- Timestamp:
- 07/07/2021 10:32:56 AM (5 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post/objects.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/objects.php
r51331 r51367 114 114 115 115 $this->assertIsArray( $post->post_category ); 116 $this->assert Same( 1, count( $post->post_category ));116 $this->assertCount( 1, $post->post_category ); 117 117 $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] ); 118 118 $term1 = wp_insert_term( 'Foo', 'category' ); … … 120 120 $term3 = wp_insert_term( 'Baz', 'category' ); 121 121 wp_set_post_categories( $post_id, array( $term1['term_id'], $term2['term_id'], $term3['term_id'] ) ); 122 $this->assert Same( 3, count( $post->post_category ));122 $this->assertCount( 3, $post->post_category ); 123 123 $this->assertSame( array( $term2['term_id'], $term3['term_id'], $term1['term_id'] ), $post->post_category ); 124 124 125 125 $post = get_post( $post_id, ARRAY_A ); 126 $this->assert Same( 3, count( $post['post_category'] ));126 $this->assertCount( 3, $post['post_category'] ); 127 127 $this->assertSame( array( $term2['term_id'], $term3['term_id'], $term1['term_id'] ), $post['post_category'] ); 128 128 } … … 136 136 wp_set_post_tags( $post_id, 'Foo, Bar, Baz' ); 137 137 $this->assertIsArray( $post->tags_input ); 138 $this->assert Same( 3, count( $post->tags_input ));138 $this->assertCount( 3, $post->tags_input ); 139 139 $this->assertSame( array( 'Bar', 'Baz', 'Foo' ), $post->tags_input ); 140 140 141 141 $post = get_post( $post_id, ARRAY_A ); 142 142 $this->assertIsArray( $post['tags_input'] ); 143 $this->assert Same( 3, count( $post['tags_input'] ));143 $this->assertCount( 3, $post['tags_input'] ); 144 144 $this->assertSame( array( 'Bar', 'Baz', 'Foo' ), $post['tags_input'] ); 145 145 }
Note: See TracChangeset
for help on using the changeset viewer.