Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Imran92 committed Sep 9, 2024
1 parent 704bd16 commit 0589c5e
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ public function testCourseArchivePage_WhenRendered_RendersQueryListBlockIfPageCo
$this->assertStringContainsString( 'wp-block-sensei-lms-course-list', $post->post_content );
}

public function testHandleRequest_WhenCalled_SetsGlobalWpQueryWithCorrectIsSingularAndQueryObjectId() {
/* ARRANGE */
Sensei_Setup_Wizard::instance()->pages->create_pages();

/* ACT */
$this->handler->handle_request();

/* ASSERT */
$this->assertTrue( is_singular() );
$this->assertEquals( 0, get_queried_object_id() );
}

/**
* Helper to set up the current request to be a course archive page. This request
* will be handled by the unsupported theme handler if the theme is not
Expand Down

0 comments on commit 0589c5e

Please sign in to comment.