From 0f3def89f00eaca61c6004557c00f1cb6c709e7c Mon Sep 17 00:00:00 2001 From: Gary Jones Date: Sun, 23 Jul 2023 22:15:17 +0100 Subject: [PATCH] Tests: Update Queried Object tests - Mark one test as requiring multisite. - Remove the other test, as it was causing an issue, and doesn't seem to be testing anything about CAP anyway. --- tests/test-author-queried-object.php | 35 +++------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/tests/test-author-queried-object.php b/tests/test-author-queried-object.php index c88bf592..ea38f806 100644 --- a/tests/test-author-queried-object.php +++ b/tests/test-author-queried-object.php @@ -11,8 +11,11 @@ class Test_Author_Queried_Object extends CoAuthorsPlus_TestCase { * have at least one published post. This matches core behavior. * * @see https://core.trac.wordpress.org/changeset/27290 + * + * @group ms-required */ function test__author_queried_object_fix() { + global $wp_rewrite, $coauthors_plus; /** @@ -78,37 +81,5 @@ function test__author_queried_object_fix() { $this->assertEquals( false, get_user_by( 'id', $author2 ) ); restore_current_blog(); - - } - - - /** - * On author pages, when paginated, - * if page number is outside the range, throws 404 - */ - function test__author_non_existent_page_throws_404() { - global $wp_rewrite; - - /** - * Set up - */ - $author = $this->factory()->user->create( array( 'user_login' => 'author' ) ); - $blog = $this->factory()->blog->create( array( 'user_id' => $author ) ); - - switch_to_blog($blog); - $wp_rewrite->init(); - - /** - * Author non existent page throws 404 - */ - $non_existent_page = 1000; - $this->go_to( get_author_posts_url( $author ) . 'page/' . $non_existent_page ); - $this->assertQueryTrue( 'is_404' ); - - /** - * Author existent page loads - */ - $this->go_to( get_author_posts_url( $author ) ); - $this->assertQueryTrue( 'is_archive', 'is_author' ); } }