mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 05:04:31 +00:00
Tests: Add missing @covers tags for Tests_Admin_wpCommunityEvents.
Adds missing and moves placement of existing @covers tags for consistency. Follow-up to [40607], [42726], [49145]. Props pbearne, jrf, hellofromTonya. See #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@51725 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -69,6 +69,8 @@ class Tests_Admin_wpCommunityEvents extends WP_UnitTestCase {
|
||||
* Test: get_events() should return an instance of WP_Error if the response code is not 200.
|
||||
*
|
||||
* @since 4.8.0
|
||||
*
|
||||
* @covers WP_Community_Events::get_events
|
||||
*/
|
||||
public function test_get_events_bad_response_code() {
|
||||
add_filter( 'pre_http_request', array( $this, '_http_request_bad_response_code' ) );
|
||||
@@ -82,6 +84,8 @@ class Tests_Admin_wpCommunityEvents extends WP_UnitTestCase {
|
||||
* Test: The response body should not be cached if the response code is not 200.
|
||||
*
|
||||
* @since 4.8.0
|
||||
*
|
||||
* @covers WP_Community_Events::get_cached_events
|
||||
*/
|
||||
public function test_get_cached_events_bad_response_code() {
|
||||
add_filter( 'pre_http_request', array( $this, '_http_request_bad_response_code' ) );
|
||||
@@ -117,6 +121,8 @@ class Tests_Admin_wpCommunityEvents extends WP_UnitTestCase {
|
||||
* the required properties.
|
||||
*
|
||||
* @since 4.8.0
|
||||
*
|
||||
* @covers WP_Community_Events::get_events
|
||||
*/
|
||||
public function test_get_events_invalid_response() {
|
||||
add_filter( 'pre_http_request', array( $this, '_http_request_invalid_response' ) );
|
||||
@@ -130,6 +136,8 @@ class Tests_Admin_wpCommunityEvents extends WP_UnitTestCase {
|
||||
* Test: The response body should not be cached if it does not have the required properties.
|
||||
*
|
||||
* @since 4.8.0
|
||||
*
|
||||
* @covers WP_Community_Events::get_cached_events
|
||||
*/
|
||||
public function test_get_cached_events_invalid_response() {
|
||||
add_filter( 'pre_http_request', array( $this, '_http_request_invalid_response' ) );
|
||||
@@ -165,6 +173,8 @@ class Tests_Admin_wpCommunityEvents extends WP_UnitTestCase {
|
||||
* an events array with individual events that have Unix start/end timestamps.
|
||||
*
|
||||
* @since 4.8.0
|
||||
*
|
||||
* @covers WP_Community_Events::get_events
|
||||
*/
|
||||
public function test_get_events_valid_response() {
|
||||
add_filter( 'pre_http_request', array( $this, '_http_request_valid_response' ) );
|
||||
@@ -184,6 +194,8 @@ class Tests_Admin_wpCommunityEvents extends WP_UnitTestCase {
|
||||
* timestamps for each event.
|
||||
*
|
||||
* @since 4.8.0
|
||||
*
|
||||
* @covers WP_Community_Events::get_cached_events
|
||||
*/
|
||||
public function test_get_cached_events_valid_response() {
|
||||
add_filter( 'pre_http_request', array( $this, '_http_request_valid_response' ) );
|
||||
@@ -287,9 +299,9 @@ class Tests_Admin_wpCommunityEvents extends WP_UnitTestCase {
|
||||
/**
|
||||
* Test: `trim_events()` should immediately remove expired events.
|
||||
*
|
||||
* @covers WP_Community_Events::trim_events
|
||||
*
|
||||
* @since 5.5.2
|
||||
*
|
||||
* @covers WP_Community_Events::trim_events
|
||||
*/
|
||||
public function test_trim_expired_events() {
|
||||
$trim_events = new ReflectionMethod( $this->instance, 'trim_events' );
|
||||
@@ -315,10 +327,10 @@ class Tests_Admin_wpCommunityEvents extends WP_UnitTestCase {
|
||||
/**
|
||||
* Test: get_events() should return the events with the WordCamp pinned in the prepared list.
|
||||
*
|
||||
* @covers WP_Community_Events::trim_events
|
||||
*
|
||||
* @since 4.9.7
|
||||
* @since 5.5.2 Tests `trim_events()` directly instead of indirectly via `get_events()`.
|
||||
*
|
||||
* @covers WP_Community_Events::trim_events
|
||||
*/
|
||||
public function test_trim_events_pin_wordcamp() {
|
||||
$trim_events = new ReflectionMethod( $this->instance, 'trim_events' );
|
||||
@@ -420,10 +432,10 @@ class Tests_Admin_wpCommunityEvents extends WP_UnitTestCase {
|
||||
* Test: get_events() shouldn't stick an extra WordCamp when there's already one that naturally
|
||||
* falls into the list.
|
||||
*
|
||||
* @covers WP_Community_Events::trim_events
|
||||
*
|
||||
* @since 4.9.7
|
||||
* @since 5.5.2 Tests `trim_events()` directly instead of indirectly via `get_events()`.
|
||||
*
|
||||
* @covers WP_Community_Events::trim_events
|
||||
*/
|
||||
public function test_trim_events_dont_pin_multiple_wordcamps() {
|
||||
$trim_events = new ReflectionMethod( $this->instance, 'trim_events' );
|
||||
@@ -545,6 +557,8 @@ class Tests_Admin_wpCommunityEvents extends WP_UnitTestCase {
|
||||
* @dataProvider data_get_unsafe_client_ip
|
||||
*
|
||||
* @ticket 41083
|
||||
*
|
||||
* @covers WP_Community_Events::get_unsafe_client_ip
|
||||
*/
|
||||
public function test_get_unsafe_client_ip( $raw_ip, $expected_result ) {
|
||||
$_SERVER['REMOTE_ADDR'] = 'this should not be used';
|
||||
|
||||
Reference in New Issue
Block a user