Changeset 42343 for trunk/tests/phpunit/tests/bookmark/getBookmarks.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/bookmark/getBookmarks.php
r37565 r42343 10 10 $bookmarks = self::factory()->bookmark->create_many( 2 ); 11 11 12 $found1 = get_bookmarks( array( 13 'orderby' => 'link_id', 14 ) ); 12 $found1 = get_bookmarks( 13 array( 14 'orderby' => 'link_id', 15 ) 16 ); 15 17 16 18 $num_queries = $wpdb->num_queries; 17 19 18 $found2 = get_bookmarks( array( 19 'orderby' => 'link_id', 20 ) ); 20 $found2 = get_bookmarks( 21 array( 22 'orderby' => 'link_id', 23 ) 24 ); 21 25 22 26 $this->assertEqualSets( $found1, $found2 ); … … 30 34 31 35 // Prime cache. 32 $found1 = get_bookmarks( array( 33 'orderby' => 'link_id', 34 ) ); 36 $found1 = get_bookmarks( 37 array( 38 'orderby' => 'link_id', 39 ) 40 ); 35 41 36 42 $num_queries = $wpdb->num_queries; 37 43 38 $bookmarks[] = wp_insert_link( array( 39 'link_name' => 'foo', 40 'link_url' => 'http://example.com', 41 ) ); 44 $bookmarks[] = wp_insert_link( 45 array( 46 'link_name' => 'foo', 47 'link_url' => 'http://example.com', 48 ) 49 ); 42 50 43 $found2 = get_bookmarks( array( 44 'orderby' => 'link_id', 45 ) ); 51 $found2 = get_bookmarks( 52 array( 53 'orderby' => 'link_id', 54 ) 55 ); 46 56 47 57 $this->assertEqualSets( $bookmarks, wp_list_pluck( $found2, 'link_id' ) ); … … 57 67 $bookmarks = self::factory()->bookmark->create_many( 2 ); 58 68 59 $found1 = get_bookmarks( array( 60 'orderby' => 'rand', 61 ) ); 69 $found1 = get_bookmarks( 70 array( 71 'orderby' => 'rand', 72 ) 73 ); 62 74 63 75 $num_queries = $wpdb->num_queries; 64 76 65 $found2 = get_bookmarks( array( 66 'orderby' => 'rand', 67 ) ); 77 $found2 = get_bookmarks( 78 array( 79 'orderby' => 'rand', 80 ) 81 ); 68 82 69 83 // equal sets != same order
Note: See TracChangeset
for help on using the changeset viewer.