From 5b3cb96ce0d406ab8bade30333aead03b81af7ad Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 11 Feb 2021 20:53:19 +0000 Subject: [PATCH] Tests: Add missing `@covers` tags for files in `phpunit/tests/error-protection/`. Props patopaiar, jrf. See #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@50289 602fd350-edb4-49c9-b593-d223f7449a82 --- .../recovery-mode-cookie-service.php | 10 +++++++ .../recovery-mode-key-service.php | 27 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/tests/phpunit/tests/error-protection/recovery-mode-cookie-service.php b/tests/phpunit/tests/error-protection/recovery-mode-cookie-service.php index 90ca646114..e261645d0a 100644 --- a/tests/phpunit/tests/error-protection/recovery-mode-cookie-service.php +++ b/tests/phpunit/tests/error-protection/recovery-mode-cookie-service.php @@ -7,6 +7,8 @@ class Tests_Recovery_Mode_Cookie_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_cookie */ public function test_validate_cookie_returns_wp_error_if_invalid_format() { @@ -27,6 +29,8 @@ class Tests_Recovery_Mode_Cookie_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_cookie */ public function test_validate_cookie_returns_wp_error_if_expired() { $service = new WP_Recovery_Mode_Cookie_Service(); @@ -44,6 +48,8 @@ class Tests_Recovery_Mode_Cookie_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_cookie */ public function test_validate_cookie_returns_wp_error_if_signature_mismatch() { $service = new WP_Recovery_Mode_Cookie_Service(); @@ -60,6 +66,8 @@ class Tests_Recovery_Mode_Cookie_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_cookie */ public function test_validate_cookie_returns_wp_error_if_created_at_is_invalid_format() { $service = new WP_Recovery_Mode_Cookie_Service(); @@ -77,6 +85,8 @@ class Tests_Recovery_Mode_Cookie_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_cookie */ public function test_validate_cookie_returns_true_for_valid_cookie() { diff --git a/tests/phpunit/tests/error-protection/recovery-mode-key-service.php b/tests/phpunit/tests/error-protection/recovery-mode-key-service.php index d5c513c3d1..5d66b4bbff 100644 --- a/tests/phpunit/tests/error-protection/recovery-mode-key-service.php +++ b/tests/phpunit/tests/error-protection/recovery-mode-key-service.php @@ -7,6 +7,9 @@ class Tests_Recovery_Mode_Key_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::generate_recovery_mode_token + * @covers WP_Recovery_Mode_Cookie_Service::generate_and_store_recovery_mode_key */ public function test_generate_and_store_recovery_mode_key_returns_recovery_key() { $service = new WP_Recovery_Mode_Key_Service(); @@ -18,6 +21,8 @@ class Tests_Recovery_Mode_Key_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_recovery_mode_key */ public function test_validate_recovery_mode_key_returns_wp_error_if_no_key_set() { $service = new WP_Recovery_Mode_Key_Service(); @@ -29,6 +34,8 @@ class Tests_Recovery_Mode_Key_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_recovery_mode_key */ public function test_validate_recovery_mode_key_returns_wp_error_if_data_missing() { update_option( 'recovery_keys', 'gibberish' ); @@ -42,6 +49,8 @@ class Tests_Recovery_Mode_Key_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_recovery_mode_key */ public function test_validate_recovery_mode_key_returns_wp_error_if_bad() { update_option( 'recovery_keys', array( 'token' => 'gibberish' ) ); @@ -56,6 +65,8 @@ class Tests_Recovery_Mode_Key_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_recovery_mode_key */ public function test_validate_recovery_mode_key_returns_wp_error_if_stored_format_is_invalid() { @@ -71,6 +82,8 @@ class Tests_Recovery_Mode_Key_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_recovery_mode_key */ public function test_validate_recovery_mode_key_returns_wp_error_if_empty_key() { $service = new WP_Recovery_Mode_Key_Service(); @@ -84,6 +97,8 @@ class Tests_Recovery_Mode_Key_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_recovery_mode_key */ public function test_validate_recovery_mode_key_returns_wp_error_if_hash_mismatch() { $service = new WP_Recovery_Mode_Key_Service(); @@ -97,6 +112,8 @@ class Tests_Recovery_Mode_Key_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_recovery_mode_key */ public function test_validate_recovery_mode_key_returns_wp_error_if_expired() { $service = new WP_Recovery_Mode_Key_Service(); @@ -115,6 +132,8 @@ class Tests_Recovery_Mode_Key_Service extends WP_UnitTestCase { /** * @ticket 46130 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_recovery_mode_key */ public function test_validate_recovery_mode_key_returns_true_for_valid_key() { $service = new WP_Recovery_Mode_Key_Service(); @@ -125,6 +144,8 @@ class Tests_Recovery_Mode_Key_Service extends WP_UnitTestCase { /** * @ticket 46595 + * + * @covers WP_Recovery_Mode_Cookie_Service::validate_recovery_mode_key */ public function test_validate_recovery_mode_key_returns_error_if_token_used_more_than_once() { $service = new WP_Recovery_Mode_Key_Service(); @@ -142,6 +163,10 @@ class Tests_Recovery_Mode_Key_Service extends WP_UnitTestCase { /** * @ticket 46595 + * + * @covers WP_Recovery_Mode_Cookie_Service::generate_recovery_mode_token + * @covers WP_Recovery_Mode_Cookie_Service::generate_and_store_recovery_mode_key + * @covers WP_Recovery_Mode_Cookie_Service::validate_recovery_mode_key */ public function test_validate_recovery_mode_key_returns_error_if_token_used_more_than_once_more_than_key_stored() { $service = new WP_Recovery_Mode_Key_Service(); @@ -164,6 +189,8 @@ class Tests_Recovery_Mode_Key_Service extends WP_UnitTestCase { /** * @ticket 46595 + * + * @covers WP_Recovery_Mode_Cookie_Service::clean_expired_keys */ public function test_clean_expired_keys() { $service = new WP_Recovery_Mode_Key_Service();