@@ -721,7 +721,7 @@ public function remove_added_uploads()
721
721
* @since 4.0.0
722
722
*
723
723
* @param string $dir Path to the directory to scan.
724
- * @return array List of file paths.
724
+ * @return string[] List of file paths.
725
725
*/
726
726
public function files_in_dir ($ dir )
727
727
{
@@ -731,7 +731,7 @@ public function files_in_dir($dir)
731
731
*
732
732
* @since 4.0.0
733
733
*
734
- * @return array List of file paths.
734
+ * @return string[] List of file paths.
735
735
*/
736
736
public function scan_user_uploads ()
737
737
{
@@ -834,6 +834,86 @@ protected function update_post_modified($post_id, $date)
834
834
public static function touch ($ file )
835
835
{
836
836
}
837
+ /**
838
+ * Wrapper for `wp_safe_remote_request()` that retries on error and skips the test on timeout.
839
+ *
840
+ * @param string $url URL to retrieve.
841
+ * @param array $args Optional. Request arguments. Default empty array.
842
+ * @return array|WP_Error The response or WP_Error on failure.
843
+ */
844
+ protected function wp_safe_remote_request ($ url , $ args = array ())
845
+ {
846
+ }
847
+ /**
848
+ * Wrapper for `wp_safe_remote_get()` that retries on error and skips the test on timeout.
849
+ *
850
+ * @param string $url URL to retrieve.
851
+ * @param array $args Optional. Request arguments. Default empty array.
852
+ * @return array|WP_Error The response or WP_Error on failure.
853
+ */
854
+ protected function wp_safe_remote_get ($ url , $ args = array ())
855
+ {
856
+ }
857
+ /**
858
+ * Wrapper for `wp_safe_remote_post()` that retries on error and skips the test on timeout.
859
+ *
860
+ * @param string $url URL to retrieve.
861
+ * @param array $args Optional. Request arguments. Default empty array.
862
+ * @return array|WP_Error The response or WP_Error on failure.
863
+ */
864
+ protected function wp_safe_remote_post ($ url , $ args = array ())
865
+ {
866
+ }
867
+ /**
868
+ * Wrapper for `wp_safe_remote_head()` that retries on error and skips the test on timeout.
869
+ *
870
+ * @param string $url URL to retrieve.
871
+ * @param array $args Optional. Request arguments. Default empty array.
872
+ * @return array|WP_Error The response or WP_Error on failure.
873
+ */
874
+ protected function wp_safe_remote_head ($ url , $ args = array ())
875
+ {
876
+ }
877
+ /**
878
+ * Wrapper for `wp_remote_request()` that retries on error and skips the test on timeout.
879
+ *
880
+ * @param string $url URL to retrieve.
881
+ * @param array $args Optional. Request arguments. Default empty array.
882
+ * @return array|WP_Error The response or WP_Error on failure.
883
+ */
884
+ protected function wp_remote_request ($ url , $ args = array ())
885
+ {
886
+ }
887
+ /**
888
+ * Wrapper for `wp_remote_get()` that retries on error and skips the test on timeout.
889
+ *
890
+ * @param string $url URL to retrieve.
891
+ * @param array $args Optional. Request arguments. Default empty array.
892
+ * @return array|WP_Error The response or WP_Error on failure.
893
+ */
894
+ protected function wp_remote_get ($ url , $ args = array ())
895
+ {
896
+ }
897
+ /**
898
+ * Wrapper for `wp_remote_post()` that retries on error and skips the test on timeout.
899
+ *
900
+ * @param string $url URL to retrieve.
901
+ * @param array $args Optional. Request arguments. Default empty array.
902
+ * @return array|WP_Error The response or WP_Error on failure.
903
+ */
904
+ protected function wp_remote_post ($ url , $ args = array ())
905
+ {
906
+ }
907
+ /**
908
+ * Wrapper for `wp_remote_head()` that retries on error and skips the test on timeout.
909
+ *
910
+ * @param string $url URL to retrieve.
911
+ * @param array $args Optional. Request arguments. Default empty array.
912
+ * @return array|WP_Error The response or WP_Error on failure.
913
+ */
914
+ protected function wp_remote_head ($ url , $ args = array ())
915
+ {
916
+ }
837
917
}
838
918
/**
839
919
* A class to handle additional command line arguments passed to the script.
@@ -931,6 +1011,42 @@ public function render($attributes = array(), $content = '')
931
1011
{
932
1012
}
933
1013
}
1014
+ /**
1015
+ * WP_Fake_Hasher for testing
1016
+ *
1017
+ * @package WordPress
1018
+ * @since 6.8.0
1019
+ */
1020
+ /**
1021
+ * Test class.
1022
+ *
1023
+ * @since 6.8.0
1024
+ */
1025
+ class WP_Fake_Hasher
1026
+ {
1027
+ public function __construct ()
1028
+ {
1029
+ }
1030
+ /**
1031
+ * Hashes a password.
1032
+ *
1033
+ * @param string $password Password to hash.
1034
+ * @return string Hashed password.
1035
+ */
1036
+ public function HashPassword (string $ password )
1037
+ {
1038
+ }
1039
+ /**
1040
+ * Checks the password hash.
1041
+ *
1042
+ * @param string $password Password to check.
1043
+ * @param string $hash Hash to check against.
1044
+ * @return bool Whether the password hash is valid.
1045
+ */
1046
+ public function CheckPassword (string $ password , string $ hash )
1047
+ {
1048
+ }
1049
+ }
934
1050
/**
935
1051
* Unit tests covering WP_REST_Controller functionality using a flexible schema.
936
1052
*
@@ -2230,7 +2346,12 @@ public function __invoke()
2230
2346
{
2231
2347
}
2232
2348
}
2233
- class MockPHPMailer extends \PHPMailer \PHPMailer \PHPMailer
2349
+ /**
2350
+ * Test class extending WP_PHPMailer.
2351
+ *
2352
+ * @since 4.5.0
2353
+ */
2354
+ class MockPHPMailer extends \WP_PHPMailer
2234
2355
{
2235
2356
public $ mock_sent = array ();
2236
2357
public function preSend ()
0 commit comments