Skip to content

Commit

Permalink
Tests: Update Queried Object tests
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
GaryJones committed Jul 23, 2023
1 parent 33a9a2f commit 0a60b44
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions tests/test-author-queried-object.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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' );
}
}

0 comments on commit 0a60b44

Please sign in to comment.