Make WordPress Core

Changeset 55250


Ignore:
Timestamp:
02/07/2023 09:24:00 AM (14 months ago)
Author:
audrasjb
Message:

Build/Test Tools: Add unit tests for wp_set_password hook.

Follow-up to [55056].

Props audrasjb, SergeyBiryukov, costdev.
Fixes #57436.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/auth.php

    r54090 r55250  
    9999            $this->assertSame( $this->user->ID, $authed_user->ID );
    100100        }
     101    }
     102
     103    /**
     104     * Tests hooking into wp_set_password().
     105     *
     106     * @ticket 57436
     107     *
     108     * @covers ::wp_set_password
     109     */
     110    public function test_wp_set_password_action() {
     111        $action = new MockAction();
     112
     113        add_action( 'wp_set_password', array( $action, 'action' ) );
     114        wp_set_password( 'A simple password', self::$user_id );
     115
     116        $this->assertSame( 1, $action->get_call_count() );
    101117    }
    102118
Note: See TracChangeset for help on using the changeset viewer.