Changeset 47781 for trunk/tests/phpunit/includes/testcase-canonical.php
- Timestamp:
- 05/10/2020 08:29:18 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase-canonical.php
r47122 r47781 62 62 ) 63 63 ); 64 $post_id = $factory->post->create( 64 65 $gallery_post_id = $factory->post->create( 65 66 array( 66 67 'post_title' => 'post-format-test-gallery', … … 68 69 ) 69 70 ); 70 self::$post_ids[] = $post_id; 71 $factory->post->create( 71 72 self::$post_ids[] = $gallery_post_id; 73 74 self::$post_ids[] = $factory->post->create( 72 75 array( 73 76 'import_id' => 611, 74 77 'post_type' => 'attachment', 75 78 'post_title' => 'canola2', 76 'post_parent' => $post_id, 77 ) 78 ); 79 self::$post_ids[] = $post_id; 80 81 self::$post_ids[] = $factory->post->create( 82 array( 83 'post_title' => 'images-test', 79 'post_parent' => $gallery_post_id, 80 ) 81 ); 82 83 self::$post_ids[] = $factory->post->create( 84 array( 85 'post_title' => 'images-test', 86 'post_date' => '2008-09-03 00:00:00', 87 ) 88 ); 89 90 self::$post_ids[] = $factory->post->create( 91 array( 92 'post_title' => 'multipage-post-test', 84 93 'post_date' => '2008-09-03 00:00:00', 85 94 'post_content' => 'Page 1 <!--nextpage--> Page 2 <!--nextpage--> Page 3', … … 87 96 ); 88 97 89 $post_id = $factory->post->create( 98 self::$post_ids[] = $factory->post->create( 99 array( 100 'post_title' => 'non-paged-post-test', 101 'post_date' => '2008-09-03 00:00:00', 102 ) 103 ); 104 105 $comment_post_id = $factory->post->create( 90 106 array( 91 107 'import_id' => 149, … … 94 110 ) 95 111 ); 96 self::$post_ids[] = $post_id; 97 self::$comment_ids = $factory->comment->create_post_comments( $post_id, 15 ); 112 113 self::$post_ids[] = $comment_post_id; 114 self::$comment_ids = $factory->comment->create_post_comments( $comment_post_id, 15 ); 98 115 99 116 self::$post_ids[] = $factory->post->create( array( 'post_date' => '2008-09-05 00:00:00' ) ); … … 109 126 ) 110 127 ); 128 111 129 self::$post_ids[] = $factory->post->create( 112 130 array( … … 115 133 ) 116 134 ); 117 $post_id = $factory->post->create( 135 136 $parent_page_id = $factory->post->create( 118 137 array( 119 138 'post_type' => 'page', … … 121 140 ) 122 141 ); 123 self::$post_ids[] = $post_id; 142 143 self::$post_ids[] = $parent_page_id; 144 124 145 self::$post_ids[] = $factory->post->create( 125 146 array( … … 127 148 'post_type' => 'page', 128 149 'post_title' => 'child-page-1', 129 'post_parent' => $p ost_id,130 ) 131 ); 132 133 $parent_ id= $factory->post->create(150 'post_parent' => $parent_page_id, 151 ) 152 ); 153 154 $parent_page_id = $factory->post->create( 134 155 array( 135 156 'post_name' => 'parent', … … 137 158 ) 138 159 ); 139 self::$post_ids[] = $parent_id; 140 $child_id_1 = $factory->post->create( 160 161 self::$post_ids[] = $parent_page_id; 162 163 $child_id_1 = $factory->post->create( 141 164 array( 142 165 'post_name' => 'child1', 143 166 'post_type' => 'page', 144 'post_parent' => $parent_id, 145 ) 146 ); 167 'post_parent' => $parent_page_id, 168 ) 169 ); 170 147 171 self::$post_ids[] = $child_id_1; 148 $child_id_2 = $factory->post->create( 172 173 $child_id_2 = $factory->post->create( 149 174 array( 150 175 'post_name' => 'child2', 151 176 'post_type' => 'page', 152 'post_parent' => $parent_id, 153 ) 154 ); 177 'post_parent' => $parent_page_id, 178 ) 179 ); 180 155 181 self::$post_ids[] = $child_id_2; 156 $grandchild_id_1 = $factory->post->create( 182 183 $grandchild_id_1 = $factory->post->create( 157 184 array( 158 185 'post_name' => 'grandchild', … … 161 188 ) 162 189 ); 190 163 191 self::$post_ids[] = $grandchild_id_1; 164 $grandchild_id_2 = $factory->post->create( 192 193 $grandchild_id_2 = $factory->post->create( 165 194 array( 166 195 'post_name' => 'grandchild', … … 169 198 ) 170 199 ); 200 171 201 self::$post_ids[] = $grandchild_id_2; 172 202 173 $cat1 203 $cat1 = $factory->term->create( 174 204 array( 175 205 'taxonomy' => 'category', … … 177 207 ) 178 208 ); 209 179 210 self::$terms['/category/parent/'] = $cat1; 180 self::$term_ids[ $cat1 ] = 'category'; 181 182 $cat2 = $factory->term->create( 211 212 self::$term_ids[ $cat1 ] = 'category'; 213 214 $cat2 = $factory->term->create( 183 215 array( 184 216 'taxonomy' => 'category', … … 187 219 ) 188 220 ); 221 189 222 self::$terms['/category/parent/child-1/'] = $cat2; 190 self::$term_ids[ $cat2 ] = 'category'; 223 224 self::$term_ids[ $cat2 ] = 'category'; 191 225 192 226 $cat3 = $factory->term->create( … … 197 231 ) 198 232 ); 233 199 234 self::$terms['/category/parent/child-1/child-2/'] = $cat3; 200 self::$term_ids[ $cat3 ] = 'category'; 201 202 $cat4 = $factory->term->create( 235 236 self::$term_ids[ $cat3 ] = 'category'; 237 238 $cat4 = $factory->term->create( 203 239 array( 204 240 'taxonomy' => 'category', … … 206 242 ) 207 243 ); 244 208 245 self::$term_ids[ $cat4 ] = 'category'; 209 246 210 $cat5 247 $cat5 = $factory->term->create( 211 248 array( 212 249 'taxonomy' => 'category', … … 214 251 ) 215 252 ); 253 216 254 self::$term_ids[ $cat5 ] = 'category'; 217 255 218 $tag1 = $factory->term->create( array( 'name' => 'post-formats' ) ); 256 $tag1 = $factory->term->create( 257 array( 258 'name' => 'post-formats', 259 ) 260 ); 261 219 262 self::$term_ids[ $tag1 ] = 'post_tag'; 220 263 }
Note: See TracChangeset
for help on using the changeset viewer.