Skip to content

Fix tests for WordPress trunk / 6.8 #521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions features/user-application-password.feature
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ Feature: Manage user custom fields
{UUID1} {UUID2}
"""

@require-wp-5.6
# WordPress 6.8 uses BLAKE2b with wp_fast_hash() / wp_verify_fast_hash() for hashing application passwords.
# See https://make.wordpress.org/core/2025/02/17/wordpress-6-8-will-use-bcrypt-for-password-hashing/
@require-wp-5.6 @less-than-wp-6.8
Scenario: Get particular user application password hash
Given a WP install

Expand All @@ -261,16 +263,41 @@ Feature: Manage user custom fields
When I try the previous command again
Then the return code should be 1

Given I run `wp user application-password create {USER_ID} someapp --porcelain`
When I run `wp user application-password create {USER_ID} someapp --porcelain`
And save STDOUT as {PASSWORD}
And I run `wp user application-password list {USER_ID} --name=someapp --field=uuid`
And save STDOUT as {UUID}

Given I run `wp user application-password get {USER_ID} {UUID} --field=password | sed 's/\$/\\\$/g'`
When I run `wp user application-password get {USER_ID} {UUID} --field=password | sed 's/\$/\\\$/g'`
And save STDOUT as {HASH}

When I run `wp eval "var_export( wp_check_password( '{PASSWORD}', '{HASH}', {USER_ID} ) );"`
Then STDOUT should contain:
"""
true
"""

@require-wp-6.8
Scenario: Get particular user application password hash
Given a WP install

When I run `wp user create testuser testuser@example.com --porcelain`
Then STDOUT should be a number
And save STDOUT as {USER_ID}

When I try the previous command again
Then the return code should be 1

When I run `wp user application-password create {USER_ID} someapp --porcelain`
And save STDOUT as {PASSWORD}
And I run `wp user application-password list {USER_ID} --name=someapp --field=uuid`
And save STDOUT as {UUID}

When I run `wp user application-password get {USER_ID} {UUID} --field=password | sed 's/\$/\\\$/g'`
And save STDOUT as {HASH}

When I run `wp eval "var_export( wp_verify_fast_hash( '{PASSWORD}', '{HASH}', {USER_ID} ) );"`
Then STDOUT should contain:
"""
true
"""