File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
plugins/optimization-detective/tests/storage Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -389,14 +389,14 @@ static function ( $data ) {
389
389
390
390
'user_archive ' => array (
391
391
'set_up ' => function (): Closure {
392
- $ user = self ::factory ()->user ->create_and_get ();
393
- $ this ->assertInstanceOf ( WP_User::class, $ user );
394
- $ post_ids = self ::factory ()->post ->create_many ( 3 , array ( 'post_author ' => $ user -> ID ) );
395
- $ this ->go_to ( get_author_posts_url ( $ user -> ID ) );
392
+ $ user_id = self ::factory ()->user ->create ();
393
+ $ this ->assertIsInt ( $ user_id );
394
+ $ post_ids = self ::factory ()->post ->create_many ( 3 , array ( 'post_author ' => $ user_id ) );
395
+ $ this ->go_to ( get_author_posts_url ( $ user_id ) );
396
396
$ GLOBALS ['template ' ] = trailingslashit ( get_template_directory () ) . 'author.php ' ;
397
397
398
- return function ( array $ etag_data ) use ( $ user , $ post_ids ): void {
399
- $ this ->assertSame ( $ user -> ID , $ etag_data ['queried_object ' ]['id ' ] );
398
+ return function ( array $ etag_data ) use ( $ user_id , $ post_ids ): void {
399
+ $ this ->assertSame ( $ user_id , $ etag_data ['queried_object ' ]['id ' ] );
400
400
$ this ->assertSame ( 'user ' , $ etag_data ['queried_object ' ]['type ' ] );
401
401
$ this ->assertCount ( 3 , $ etag_data ['queried_posts ' ] );
402
402
$ this ->assertEqualSets ( $ post_ids , wp_list_pluck ( $ etag_data ['queried_posts ' ], 'id ' ) );
You can’t perform that action at this time.
0 commit comments