Changeset 44546 for trunk/tests/phpunit/tests/bookmark/getBookmarks.php
- Timestamp:
- 01/10/2019 09:05:50 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/bookmark/getBookmarks.php
r42343 r44546 85 85 $this->assertTrue( $num_queries < $wpdb->num_queries ); 86 86 } 87 88 public function test_exclude_param_gets_properly_parsed_as_list() { 89 $bookmarks = self::factory()->bookmark->create_many( 3 ); 90 91 $found = get_bookmarks( 92 array( 93 'exclude' => ',,', 94 ) 95 ); 96 $found_ids = array(); 97 foreach( $found as $bookmark ) { 98 $found_ids[] = $bookmark->link_id; 99 } 100 101 // equal sets != same order. 102 $this->assertEqualSets( $bookmarks, $found_ids ); 103 } 104 105 public function test_include_param_gets_properly_parsed_as_list() { 106 $bookmarks = self::factory()->bookmark->create_many( 3 ); 107 108 $found = get_bookmarks( 109 array( 110 'include' => ',,', 111 ) 112 ); 113 $found_ids = array(); 114 foreach( $found as $bookmark ) { 115 $found_ids[] = $bookmark->link_id; 116 } 117 118 // equal sets != same order. 119 $this->assertEqualSets( $bookmarks, $found_ids ); 120 } 121 122 public function test_category_param_propelry_gets_parsed_as_list() { 123 $bookmarks = self::factory()->bookmark->create_many( 3 ); 124 $categories = self::factory()->term->create_many( 3, array( 125 'taxonomy' => 'link_category', 126 ) ); 127 $add = wp_add_object_terms( $bookmarks[0], $categories[0], 'link_category' ); 128 $add = wp_add_object_terms( $bookmarks[1], $categories[1], 'link_category' ); 129 $add = wp_add_object_terms( $bookmarks[2], $categories[2], 'link_category' ); 130 131 $found = get_bookmarks( 132 array( 133 'category' => ',,', 134 ) 135 ); 136 $found_ids = array(); 137 foreach( $found as $bookmark ) { 138 $found_ids[] = $bookmark->link_id; 139 } 140 141 // equal sets != same order. 142 $this->assertEqualSets( $bookmarks, $found_ids ); 143 } 87 144 }
Note: See TracChangeset
for help on using the changeset viewer.