Changeset 60253 for trunk/tests/phpunit/tests/url.php
- Timestamp:
- 05/26/2025 02:34:12 PM (9 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/url.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/url.php
r56549 r60253 8 8 class Tests_URL extends WP_UnitTestCase { 9 9 10 /** 11 * Author user ID. 12 * 13 * @var int $author_id 14 */ 15 public static $author_id; 16 17 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 18 self::$author_id = $factory->user->create( array( 'role' => 'author' ) ); 19 } 20 10 21 public function set_up() { 11 22 parent::set_up(); … … 387 398 */ 388 399 public function test_get_adjacent_post_should_return_private_posts_belonging_to_the_current_user() { 389 $u = self:: factory()->user->create( array( 'role' => 'author' ) );400 $u = self::$author_id; 390 401 $old_uid = get_current_user_id(); 391 402 wp_set_current_user( $u ); … … 426 437 */ 427 438 public function test_get_adjacent_post_should_return_private_posts_belonging_to_other_users_if_the_current_user_can_read_private_posts() { 428 $u1 = self:: factory()->user->create( array( 'role' => 'author' ) );439 $u1 = self::$author_id; 429 440 $u2 = self::factory()->user->create( array( 'role' => 'administrator' ) ); 430 441 $old_uid = get_current_user_id(); … … 466 477 */ 467 478 public function test_get_adjacent_post_should_not_return_private_posts_belonging_to_other_users_if_the_current_user_cannot_read_private_posts() { 468 $u1 = self:: factory()->user->create( array( 'role' => 'author' ) );479 $u1 = self::$author_id; 469 480 $u2 = self::factory()->user->create( array( 'role' => 'author' ) ); 470 481 $old_uid = get_current_user_id();
Note: See TracChangeset
for help on using the changeset viewer.