Changeset 35225 for trunk/tests/phpunit/tests/url.php
- Timestamp:
- 10/16/2015 09:04:12 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/url.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/url.php
r34703 r35225 273 273 public function test_get_adjacent_post() { 274 274 $now = time(); 275 $post_id = $this->factory->post->create( array( 'post_date' => date( 'Y-m-d H:i:s', $now - 1 ) ) );276 $post_id2 = $this->factory->post->create( array( 'post_date' => date( 'Y-m-d H:i:s', $now ) ) );275 $post_id = self::$factory->post->create( array( 'post_date' => date( 'Y-m-d H:i:s', $now - 1 ) ) ); 276 $post_id2 = self::$factory->post->create( array( 'post_date' => date( 'Y-m-d H:i:s', $now ) ) ); 277 277 278 278 if ( ! isset( $GLOBALS['post'] ) ) … … 306 306 */ 307 307 public function test_get_adjacent_post_should_return_private_posts_belonging_to_the_current_user() { 308 $u = $this->factory->user->create( array( 'role' => 'author' ) );308 $u = self::$factory->user->create( array( 'role' => 'author' ) ); 309 309 $old_uid = get_current_user_id(); 310 310 wp_set_current_user( $u ); 311 311 312 312 $now = time(); 313 $p1 = $this->factory->post->create( array( 'post_author' => $u, 'post_status' => 'private', 'post_date' => date( 'Y-m-d H:i:s', $now - 1 ) ) );314 $p2 = $this->factory->post->create( array( 'post_author' => $u, 'post_date' => date( 'Y-m-d H:i:s', $now ) ) );313 $p1 = self::$factory->post->create( array( 'post_author' => $u, 'post_status' => 'private', 'post_date' => date( 'Y-m-d H:i:s', $now - 1 ) ) ); 314 $p2 = self::$factory->post->create( array( 'post_author' => $u, 'post_date' => date( 'Y-m-d H:i:s', $now ) ) ); 315 315 316 316 if ( ! isset( $GLOBALS['post'] ) ) { … … 332 332 */ 333 333 public function test_get_adjacent_post_should_return_private_posts_belonging_to_other_users_if_the_current_user_can_read_private_posts() { 334 $u1 = $this->factory->user->create( array( 'role' => 'author' ) );335 $u2 = $this->factory->user->create( array( 'role' => 'administrator' ) );334 $u1 = self::$factory->user->create( array( 'role' => 'author' ) ); 335 $u2 = self::$factory->user->create( array( 'role' => 'administrator' ) ); 336 336 $old_uid = get_current_user_id(); 337 337 wp_set_current_user( $u2 ); 338 338 339 339 $now = time(); 340 $p1 = $this->factory->post->create( array( 'post_author' => $u1, 'post_status' => 'private', 'post_date' => date( 'Y-m-d H:i:s', $now - 1 ) ) );341 $p2 = $this->factory->post->create( array( 'post_author' => $u1, 'post_date' => date( 'Y-m-d H:i:s', $now ) ) );340 $p1 = self::$factory->post->create( array( 'post_author' => $u1, 'post_status' => 'private', 'post_date' => date( 'Y-m-d H:i:s', $now - 1 ) ) ); 341 $p2 = self::$factory->post->create( array( 'post_author' => $u1, 'post_date' => date( 'Y-m-d H:i:s', $now ) ) ); 342 342 343 343 if ( ! isset( $GLOBALS['post'] ) ) { … … 359 359 */ 360 360 public function test_get_adjacent_post_should_not_return_private_posts_belonging_to_other_users_if_the_current_user_cannot_read_private_posts() { 361 $u1 = $this->factory->user->create( array( 'role' => 'author' ) );362 $u2 = $this->factory->user->create( array( 'role' => 'author' ) );361 $u1 = self::$factory->user->create( array( 'role' => 'author' ) ); 362 $u2 = self::$factory->user->create( array( 'role' => 'author' ) ); 363 363 $old_uid = get_current_user_id(); 364 364 wp_set_current_user( $u2 ); 365 365 366 366 $now = time(); 367 $p1 = $this->factory->post->create( array( 'post_author' => $u1, 'post_date' => date( 'Y-m-d H:i:s', $now - 2 ) ) );368 $p2 = $this->factory->post->create( array( 'post_author' => $u1, 'post_status' => 'private', 'post_date' => date( 'Y-m-d H:i:s', $now - 1 ) ) );369 $p3 = $this->factory->post->create( array( 'post_author' => $u1, 'post_date' => date( 'Y-m-d H:i:s', $now ) ) );367 $p1 = self::$factory->post->create( array( 'post_author' => $u1, 'post_date' => date( 'Y-m-d H:i:s', $now - 2 ) ) ); 368 $p2 = self::$factory->post->create( array( 'post_author' => $u1, 'post_status' => 'private', 'post_date' => date( 'Y-m-d H:i:s', $now - 1 ) ) ); 369 $p3 = self::$factory->post->create( array( 'post_author' => $u1, 'post_date' => date( 'Y-m-d H:i:s', $now ) ) ); 370 370 371 371 if ( ! isset( $GLOBALS['post'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.