Changeset 48937 for trunk/tests/phpunit/tests/term/wpSetObjectTerms.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/wpSetObjectTerms.php
r47122 r48937 114 114 $tt = wp_set_object_terms( $id, array_values( $term_id ), $this->taxonomy ); 115 115 // Should return three term taxonomy IDs. 116 $this->assert Equals( 3, count( $tt ) );116 $this->assertSame( 3, count( $tt ) ); 117 117 } 118 118 … … 120 120 foreach ( $term_id as $term => $id ) { 121 121 $actual = get_objects_in_term( $id, $this->taxonomy ); 122 $this->assert Equals( $ids, array_map( 'intval', $actual ) );122 $this->assertSame( $ids, array_map( 'intval', $actual ) ); 123 123 } 124 124 … … 126 126 foreach ( array_keys( $term_id ) as $term ) { 127 127 $t = get_term_by( 'name', $term, $this->taxonomy ); 128 $this->assert Equals( 5, $t->count );128 $this->assertSame( 5, $t->count ); 129 129 } 130 130 } … … 142 142 $tt = wp_set_object_terms( $id, $terms, $this->taxonomy ); 143 143 // Should return three term taxonomy IDs. 144 $this->assert Equals( 3, count( $tt ) );144 $this->assertSame( 3, count( $tt ) ); 145 145 // Remember which term has which term_id. 146 146 for ( $i = 0; $i < 3; $i++ ) { … … 153 153 foreach ( $term_id as $term => $id ) { 154 154 $actual = get_objects_in_term( $id, $this->taxonomy ); 155 $this->assert Equals( $ids, array_map( 'intval', $actual ) );155 $this->assertSame( $ids, array_map( 'intval', $actual ) ); 156 156 } 157 157 … … 159 159 foreach ( $terms as $term ) { 160 160 $t = get_term_by( 'name', $term, $this->taxonomy ); 161 $this->assert Equals( 5, $t->count );161 $this->assertSame( 5, $t->count ); 162 162 } 163 163 } … … 269 269 // Set the initial terms. 270 270 $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy ); 271 $this->assert Equals( 3, count( $tt_1 ) );271 $this->assertSame( 3, count( $tt_1 ) ); 272 272 273 273 // Make sure they're correct. … … 280 280 ) 281 281 ); 282 $this->assert Equals( $terms_1, $terms );282 $this->assertSame( $terms_1, $terms ); 283 283 284 284 // Change the terms. 285 285 $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy ); 286 $this->assert Equals( 2, count( $tt_2 ) );286 $this->assertSame( 2, count( $tt_2 ) ); 287 287 288 288 // Make sure they're correct. … … 295 295 ) 296 296 ); 297 $this->assert Equals( $terms_2, $terms );297 $this->assertSame( $terms_2, $terms ); 298 298 299 299 // Make sure the term taxonomy ID for 'bar' matches. 300 $this->assert Equals( $tt_1[1], $tt_2[0] );300 $this->assertSame( $tt_1[1], $tt_2[0] ); 301 301 302 302 } … … 313 313 // Set the initial terms. 314 314 $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy ); 315 $this->assert Equals( 3, count( $tt_1 ) );315 $this->assertSame( 3, count( $tt_1 ) ); 316 316 317 317 // Make sure they're correct. … … 324 324 ) 325 325 ); 326 $this->assert Equals( $terms_1, $terms );326 $this->assertSame( $terms_1, $terms ); 327 327 328 328 // Change the terms. 329 329 $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy ); 330 $this->assert Equals( 2, count( $tt_2 ) );330 $this->assertSame( 2, count( $tt_2 ) ); 331 331 332 332 // Make sure they're correct. … … 339 339 ) 340 340 ); 341 $this->assert Equals( $terms_2, $terms );341 $this->assertSame( $terms_2, $terms ); 342 342 343 343 // Make sure the term taxonomy ID for 'bar' matches.
Note: See TracChangeset
for help on using the changeset viewer.