Changeset 51454
- Timestamp:
- 07/18/2021 02:10:24 PM (3 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/bookmark/getBookmarks.php
r51139 r51454 56 56 57 57 $this->assertEqualSets( $bookmarks, wp_list_pluck( $found2, 'link_id' ) ); 58 $this->assert True( $num_queries <$wpdb->num_queries );58 $this->assertGreaterThan( $num_queries, $wpdb->num_queries ); 59 59 } 60 60 … … 83 83 // Equal sets != same order. 84 84 $this->assertEqualSets( $found1, $found2 ); 85 $this->assert True( $num_queries <$wpdb->num_queries );85 $this->assertGreaterThan( $num_queries, $wpdb->num_queries ); 86 86 } 87 87 -
trunk/tests/phpunit/tests/cron.php
r50610 r51454 127 127 128 128 // Make sure they're returned by wp_next_scheduled(). 129 $this->assert True( wp_next_scheduled( $hook ) > 0);130 $this->assert True( wp_next_scheduled( $hook, $args ) > 0);129 $this->assertGreaterThan( 0, wp_next_scheduled( $hook ) ); 130 $this->assertGreaterThan( 0, wp_next_scheduled( $hook, $args ) ); 131 131 132 132 // Clear the schedule for the no args events and make sure it's gone. … … 135 135 $this->assertFalse( wp_next_scheduled( $hook ) ); 136 136 // The args events should still be there. 137 $this->assert True( wp_next_scheduled( $hook, $args ) > 0);137 $this->assertGreaterThan( 0, wp_next_scheduled( $hook, $args ) ); 138 138 139 139 // Clear the schedule for the args events and make sure they're gone too. … … 166 166 167 167 // Make sure they're returned by wp_next_scheduled(). 168 $this->assert True( wp_next_scheduled( $hook ) > 0);169 $this->assert True( wp_next_scheduled( $hook, $args ) > 0);168 $this->assertGreaterThan( 0, wp_next_scheduled( $hook ) ); 169 $this->assertGreaterThan( 0, wp_next_scheduled( $hook, $args ) ); 170 170 171 171 // Clear the schedule for the no args events and make sure it's gone. … … 173 173 $this->assertFalse( wp_next_scheduled( $hook ) ); 174 174 // The args events should still be there. 175 $this->assert True( wp_next_scheduled( $hook, $args ) > 0);175 $this->assertGreaterThan( 0, wp_next_scheduled( $hook, $args ) ); 176 176 177 177 // Clear the schedule for the args events and make sure they're gone too. … … 199 199 200 200 // Make sure they're returned by wp_next_scheduled(). 201 $this->assert True( wp_next_scheduled( $hook ) > 0);202 $this->assert True( wp_next_scheduled( $hook, $args ) > 0);201 $this->assertGreaterThan( 0, wp_next_scheduled( $hook ) ); 202 $this->assertGreaterThan( 0, wp_next_scheduled( $hook, $args ) ); 203 203 204 204 // Clear the schedule for the no args events and make sure it's gone. … … 206 206 $this->assertFalse( wp_next_scheduled( $hook ) ); 207 207 // The args events should still be there. 208 $this->assert True( wp_next_scheduled( $hook, $args ) > 0);208 $this->assertGreaterThan( 0, wp_next_scheduled( $hook, $args ) ); 209 209 210 210 // Clear the schedule for the args events and make sure they're gone too. … … 233 233 234 234 // Make sure they're returned by wp_next_scheduled(). 235 $this->assert True( wp_next_scheduled( $hook ) > 0);236 $this->assert True( wp_next_scheduled( $hook, $args ) > 0);235 $this->assertGreaterThan( 0, wp_next_scheduled( $hook ) ); 236 $this->assertGreaterThan( 0, wp_next_scheduled( $hook, $args ) ); 237 237 238 238 // Clear the schedule and make sure it's gone. -
trunk/tests/phpunit/tests/meta.php
r51367 r51454 345 345 $negative_mid = $this->meta_id * -1; 346 346 347 $this->assert True( $negative_mid < 0);347 $this->assertLessThan( 0, $negative_mid ); 348 348 $this->assertFalse( get_metadata_by_mid( 'user', $negative_mid ) ); 349 349 $this->assertFalse( update_metadata_by_mid( 'user', $negative_mid, 'meta_new_value' ) ); -
trunk/tests/phpunit/tests/multisite/network.php
r51331 r51454 452 452 $user_count = (int) get_user_count(); 453 453 454 $this->assertTrue( $site_count > 0 && $user_count > 0 ); 454 $this->assertGreaterThan( 0, $site_count ); 455 $this->assertGreaterThan( 0, $user_count ); 455 456 } 456 457 … … 467 468 $user_count = (int) get_user_count( self::$different_network_id ); 468 469 469 $this->assertTrue( $site_count > 0 && $user_count > 0 ); 470 $this->assertGreaterThan( 0, $site_count ); 471 $this->assertGreaterThan( 0, $user_count ); 470 472 } 471 473 -
trunk/tests/phpunit/tests/post.php
r51438 r51454 81 81 $id = wp_insert_post( $post ); 82 82 $this->assertIsNumeric( $id ); 83 $this->assert True( $id > 0);83 $this->assertGreaterThan( 0, $id ); 84 84 85 85 // Fetch the post and make sure it matches. … … 137 137 // dmp( _get_cron_array() ); 138 138 $this->assertIsNumeric( $id ); 139 $this->assert True( $id > 0);139 $this->assertGreaterThan( 0, $id ); 140 140 141 141 // Fetch the post and make sure it matches. … … 260 260 // dmp( _get_cron_array() ); 261 261 $this->assertIsNumeric( $id ); 262 $this->assert True( $id > 0);262 $this->assertGreaterThan( 0, $id ); 263 263 264 264 // Fetch the post and make sure it matches. … … 381 381 // dmp( _get_cron_array() ); 382 382 $this->assertIsNumeric( $id ); 383 $this->assert True( $id > 0);383 $this->assertGreaterThan( 0, $id ); 384 384 385 385 // Fetch the post and make sure it matches. … … 794 794 ); 795 795 $insert_post_id = wp_insert_post( $post_data, true, true ); 796 $this->assertTrue( ( is_int( $insert_post_id ) && $insert_post_id > 0 ) ); 796 $this->assertIsInt( $insert_post_id ); 797 $this->assertGreaterThan( 0, $insert_post_id ); 797 798 798 799 $post = get_post( $insert_post_id ); -
trunk/tests/phpunit/tests/rest-api/rest-controller.php
r51453 r51454 514 514 $first_call_count = $listener->get_call_count( $method ); 515 515 516 $this->assert True( $first_call_count > 0);516 $this->assertGreaterThan( 0, $first_call_count ); 517 517 518 518 $request->set_param( '_fields', 'somestring' ); … … 526 526 $controller->prepare_item_for_response( $item, $request ); 527 527 528 $this->assert True( $listener->get_call_count( $method ) > $first_call_count);528 $this->assertGreaterThan( $first_call_count, $listener->get_call_count( $method ) ); 529 529 } 530 530 -
trunk/tests/phpunit/tests/term.php
r51438 r51454 156 156 $this->assertIsNumeric( $t ); 157 157 $this->assertNotWPError( $t ); 158 $this->assert True( $t > 0);158 $this->assertGreaterThan( 0, $t ); 159 159 $this->assertEquals( $initial_count + 1, wp_count_terms( array( 'taxonomy' => 'category' ) ) ); 160 160 161 161 // Make sure the term exists. 162 $this->assert True( term_exists( $term ) > 0);163 $this->assert True( term_exists( $t ) > 0);162 $this->assertGreaterThan( 0, term_exists( $term ) ); 163 $this->assertGreaterThan( 0, term_exists( $t ) ); 164 164 165 165 // Now delete it. -
trunk/tests/phpunit/tests/term/wpInsertTerm.php
r51404 r51454 30 30 $this->assertIsArray( $t ); 31 31 $this->assertNotWPError( $t ); 32 $this->assert True( $t['term_id'] > 0);33 $this->assert True( $t['term_taxonomy_id'] > 0);32 $this->assertGreaterThan( 0, $t['term_id'] ); 33 $this->assertGreaterThan( 0, $t['term_taxonomy_id'] ); 34 34 $this->assertEquals( $initial_count + 1, wp_count_terms( array( 'taxonomy' => $taxonomy ) ) ); 35 35 36 36 // Make sure the term exists. 37 $this->assert True( term_exists( $term ) > 0);38 $this->assert True( term_exists( $t['term_id'] ) > 0);37 $this->assertGreaterThan( 0, term_exists( $term ) ); 38 $this->assertGreaterThan( 0, term_exists( $t['term_id'] ) ); 39 39 40 40 // Now delete it. -
trunk/tests/phpunit/tests/theme.php
r51403 r51454 141 141 $this->assertNotEmpty( $theme['Description'] ); 142 142 $this->assertNotEmpty( $theme['Author'] ); 143 $this->assert True( version_compare( $theme['Version'], 0 ) > 0);143 $this->assertGreaterThan( 0, version_compare( $theme['Version'], 0 ) ); 144 144 $this->assertNotEmpty( $theme['Template'] ); 145 145 $this->assertNotEmpty( $theme['Stylesheet'] ); -
trunk/tests/phpunit/tests/user/wpDeleteUser.php
r51438 r51454 69 69 $post_id = wp_insert_post( $post ); 70 70 $this->assertIsNumeric( $post_id ); 71 $this->assert True( $post_id > 0);71 $this->assertGreaterThan( 0, $post_id ); 72 72 73 73 $post = get_post( $post_id ); … … 85 85 $nav_id = wp_insert_post( $post ); 86 86 $this->assertIsNumeric( $nav_id ); 87 $this->assert True( $nav_id > 0);87 $this->assertGreaterThan( 0, $nav_id ); 88 88 89 89 $post = get_post( $nav_id );
Note: See TracChangeset
for help on using the changeset viewer.