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
This commit is contained in:
Sergey Biryukov
2021-02-11 20:53:19 +00:00
parent f184ef4b6c
commit 5b3cb96ce0
2 changed files with 37 additions and 0 deletions

View File

@@ -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() {

View File

@@ -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();