Changeset 35242 for trunk/tests/phpunit/tests/link.php
- Timestamp:
- 10/17/2015 06:02:16 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/link.php
r35225 r35242 34 34 35 35 function test_wp_get_shortlink() { 36 $post_id = self:: $factory->post->create();37 $post_id2 = self:: $factory->post->create();36 $post_id = self::factory()->post->create(); 37 $post_id2 = self::factory()->post->create(); 38 38 39 39 // Basic case … … 78 78 79 79 function test_wp_get_shortlink_with_page() { 80 $post_id = self:: $factory->post->create( array( 'post_type' => 'page' ) );80 $post_id = self::factory()->post->create( array( 'post_type' => 'page' ) ); 81 81 82 82 // Basic case … … 93 93 */ 94 94 function test_wp_get_shortlink_with_home_page() { 95 $post_id = self:: $factory->post->create( array( 'post_type' => 'page' ) );95 $post_id = self::factory()->post->create( array( 'post_type' => 'page' ) ); 96 96 update_option( 'show_on_front', 'page' ); 97 97 update_option( 'page_on_front', $post_id ); … … 109 109 function test_get_adjacent_post() { 110 110 // Need some sample posts to test adjacency 111 $post_one = self:: $factory->post->create_and_get( array(111 $post_one = self::factory()->post->create_and_get( array( 112 112 'post_title' => 'First', 113 113 'post_date' => '2012-01-01 12:00:00' 114 114 ) ); 115 115 116 $post_two = self:: $factory->post->create_and_get( array(116 $post_two = self::factory()->post->create_and_get( array( 117 117 'post_title' => 'Second', 118 118 'post_date' => '2012-02-01 12:00:00' 119 119 ) ); 120 120 121 $post_three = self:: $factory->post->create_and_get( array(121 $post_three = self::factory()->post->create_and_get( array( 122 122 'post_title' => 'Third', 123 123 'post_date' => '2012-03-01 12:00:00' 124 124 ) ); 125 125 126 $post_four = self:: $factory->post->create_and_get( array(126 $post_four = self::factory()->post->create_and_get( array( 127 127 'post_title' => 'Fourth', 128 128 'post_date' => '2012-04-01 12:00:00' … … 184 184 $wpdb->insert( $wpdb->term_taxonomy, array( 'taxonomy' => 'foo', 'term_id' => 12345, 'description' => '' ) ); 185 185 186 $include = self:: $factory->term->create( array(186 $include = self::factory()->term->create( array( 187 187 'taxonomy' => 'category', 188 188 'name' => 'Include', 189 189 ) ); 190 $exclude = self:: $factory->category->create();191 192 $one = self:: $factory->post->create_and_get( array(190 $exclude = self::factory()->category->create(); 191 192 $one = self::factory()->post->create_and_get( array( 193 193 'post_date' => '2012-01-01 12:00:00', 194 194 'post_category' => array( $include, $exclude ), 195 195 ) ); 196 196 197 $two = self:: $factory->post->create_and_get( array(197 $two = self::factory()->post->create_and_get( array( 198 198 'post_date' => '2012-01-02 12:00:00', 199 199 'post_category' => array(), 200 200 ) ); 201 201 202 $three = self:: $factory->post->create_and_get( array(202 $three = self::factory()->post->create_and_get( array( 203 203 'post_date' => '2012-01-03 12:00:00', 204 204 'post_category' => array( $include, $exclude ), 205 205 ) ); 206 206 207 $four = self:: $factory->post->create_and_get( array(207 $four = self::factory()->post->create_and_get( array( 208 208 'post_date' => '2012-01-04 12:00:00', 209 209 'post_category' => array( $include ), 210 210 ) ); 211 211 212 $five = self:: $factory->post->create_and_get( array(212 $five = self::factory()->post->create_and_get( array( 213 213 'post_date' => '2012-01-05 12:00:00', 214 214 'post_category' => array( $include, $exclude ), … … 250 250 register_taxonomy( 'wptests_tax', 'post' ); 251 251 252 $t = self:: $factory->term->create( array(252 $t = self::factory()->term->create( array( 253 253 'taxonomy' => 'wptests_tax', 254 254 ) ); 255 255 256 $p1 = self:: $factory->post->create( array( 'post_date' => '2015-08-27 12:00:00' ) );257 $p2 = self:: $factory->post->create( array( 'post_date' => '2015-08-26 12:00:00' ) );258 $p3 = self:: $factory->post->create( array( 'post_date' => '2015-08-25 12:00:00' ) );256 $p1 = self::factory()->post->create( array( 'post_date' => '2015-08-27 12:00:00' ) ); 257 $p2 = self::factory()->post->create( array( 'post_date' => '2015-08-26 12:00:00' ) ); 258 $p3 = self::factory()->post->create( array( 'post_date' => '2015-08-25 12:00:00' ) ); 259 259 260 260 wp_set_post_terms( $p2, array( $t ), 'wptests_tax' ); … … 282 282 register_taxonomy( 'wptests_tax', 'post' ); 283 283 284 $t = self:: $factory->term->create( array(284 $t = self::factory()->term->create( array( 285 285 'taxonomy' => 'wptests_tax', 286 286 ) ); 287 287 288 $p1 = self:: $factory->post->create( array( 'post_date' => '2015-08-27 12:00:00' ) );289 $p2 = self:: $factory->post->create( array( 'post_date' => '2015-08-26 12:00:00' ) );290 $p3 = self:: $factory->post->create( array( 'post_date' => '2015-08-25 12:00:00' ) );288 $p1 = self::factory()->post->create( array( 'post_date' => '2015-08-27 12:00:00' ) ); 289 $p2 = self::factory()->post->create( array( 'post_date' => '2015-08-26 12:00:00' ) ); 290 $p3 = self::factory()->post->create( array( 'post_date' => '2015-08-25 12:00:00' ) ); 291 291 292 292 wp_set_post_terms( $p2, array( $t ), 'wptests_tax' ); … … 349 349 flush_rewrite_rules(); 350 350 351 $p = self:: $factory->post->create( array(351 $p = self::factory()->post->create( array( 352 352 'post_status' => 'publish', 353 353 'post_date' => strftime( '%Y-%m-%d %H:%M:%S', strtotime( '+1 day' ) ) … … 369 369 flush_rewrite_rules(); 370 370 371 $p = self:: $factory->post->create( array(371 $p = self::factory()->post->create( array( 372 372 'post_status' => 'future', 373 373 'post_type' => 'wptests_pt', … … 389 389 $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); 390 390 391 $attachment_id = self:: $factory->attachment->create_object( 'image.jpg', 0, array(391 $attachment_id = self::factory()->attachment->create_object( 'image.jpg', 0, array( 392 392 'post_mime_type' => 'image/jpeg', 393 393 'post_type' => 'attachment', … … 413 413 flush_rewrite_rules(); 414 414 415 $post_id = self:: $factory->post->create( array( 'post_type' => 'not_a_post_type' ) );416 417 $attachment_id = self:: $factory->attachment->create_object( 'image.jpg', $post_id, array(415 $post_id = self::factory()->post->create( array( 'post_type' => 'not_a_post_type' ) ); 416 417 $attachment_id = self::factory()->attachment->create_object( 'image.jpg', $post_id, array( 418 418 'post_mime_type' => 'image/jpeg', 419 419 'post_type' => 'attachment',
Note: See TracChangeset
for help on using the changeset viewer.