Changeset 52010 for trunk/tests/phpunit/tests/auth.php
- Timestamp:
- 11/04/2021 03:22:47 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/auth.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/auth.php
r51568 r52010 33 33 } 34 34 35 function set_up() {35 public function set_up() { 36 36 parent::set_up(); 37 37 … … 50 50 } 51 51 52 function test_auth_cookie_valid() {52 public function test_auth_cookie_valid() { 53 53 $cookie = wp_generate_auth_cookie( self::$user_id, time() + 3600, 'auth' ); 54 54 $this->assertSame( self::$user_id, wp_validate_auth_cookie( $cookie, 'auth' ) ); 55 55 } 56 56 57 function test_auth_cookie_invalid() {57 public function test_auth_cookie_invalid() { 58 58 // 3600 or less and +3600 may occur in wp_validate_auth_cookie(), 59 59 // as an ajax test may have defined DOING_AJAX, failing the test. … … 71 71 } 72 72 73 function test_auth_cookie_scheme() {73 public function test_auth_cookie_scheme() { 74 74 // Arbitrary scheme name. 75 75 $cookie = wp_generate_auth_cookie( self::$user_id, time() + 3600, 'foo' ); … … 84 84 * @ticket 23494 85 85 */ 86 function test_password_trimming() {86 public function test_password_trimming() { 87 87 $passwords_to_test = array( 88 88 'a password with no trailing or leading spaces', … … 109 109 * @ticket 24973 110 110 */ 111 function test_wp_hash_password_trimming() {111 public function test_wp_hash_password_trimming() { 112 112 113 113 $password = ' pass with leading whitespace'; … … 130 130 * @ticket 29217 131 131 */ 132 function test_wp_verify_nonce_with_empty_arg() {132 public function test_wp_verify_nonce_with_empty_arg() { 133 133 $this->assertFalse( wp_verify_nonce( '' ) ); 134 134 $this->assertFalse( wp_verify_nonce( null ) ); … … 138 138 * @ticket 29542 139 139 */ 140 function test_wp_verify_nonce_with_integer_arg() {140 public function test_wp_verify_nonce_with_integer_arg() { 141 141 $this->assertFalse( wp_verify_nonce( 1 ) ); 142 142 } … … 145 145 * @ticket 24030 146 146 */ 147 function test_wp_nonce_verify_failed() {147 public function test_wp_nonce_verify_failed() { 148 148 $nonce = substr( md5( uniqid() ), 0, 10 ); 149 149 $count = did_action( $this->nonce_failure_hook ); … … 157 157 * @ticket 24030 158 158 */ 159 function test_wp_nonce_verify_success() {159 public function test_wp_nonce_verify_success() { 160 160 $nonce = wp_create_nonce( 'nonce_test_action' ); 161 161 $count = did_action( $this->nonce_failure_hook ); … … 203 203 } 204 204 205 function test_password_length_limit() {205 public function test_password_length_limit() { 206 206 $limit = str_repeat( 'a', 4096 ); 207 207 … … 253 253 * @ticket 45746 254 254 */ 255 function test_user_activation_key_is_saved() {255 public function test_user_activation_key_is_saved() { 256 256 $user = get_userdata( $this->user->ID ); 257 257 $key = get_password_reset_key( $user ); … … 267 267 * @ticket 32429 268 268 */ 269 function test_user_activation_key_is_checked() {269 public function test_user_activation_key_is_checked() { 270 270 global $wpdb; 271 271 … … 305 305 * @ticket 32429 306 306 */ 307 function test_expired_user_activation_key_is_rejected() {307 public function test_expired_user_activation_key_is_rejected() { 308 308 global $wpdb; 309 309 … … 328 328 * @ticket 32429 329 329 */ 330 function test_empty_user_activation_key_fails_key_check() {330 public function test_empty_user_activation_key_fails_key_check() { 331 331 // An empty user_activation_key should not allow any key to be accepted. 332 332 $check = check_password_reset_key( 'key', $this->user->user_login ); … … 341 341 * @ticket 32429 342 342 */ 343 function test_legacy_user_activation_key_is_rejected() {343 public function test_legacy_user_activation_key_is_rejected() { 344 344 global $wpdb; 345 345 … … 371 371 * @ticket 24783 372 372 */ 373 function test_plaintext_user_activation_key_is_rejected() {373 public function test_plaintext_user_activation_key_is_rejected() { 374 374 global $wpdb; 375 375
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)