Skip to content

Add PHPUnit messages for test assertions.#12901

Open
JakePT wants to merge 2 commits into
developfrom
infrastructure/11345-phpunit-assert
Open

Add PHPUnit messages for test assertions.#12901
JakePT wants to merge 2 commits into
developfrom
infrastructure/11345-phpunit-assert

Conversation

@JakePT

@JakePT JakePT commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Addresses issue:

Relevant technical choices

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 7.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@JakePT JakePT marked this pull request as ready for review June 15, 2026 09:54

@techanvil techanvil left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JakePT, this looks good, just needs a few indentation fixes.

Comment on lines +79 to +83
$this->assertEqualSets(
array( 'foo', 'bar' ),
$response->get_data(),
'Dismissed items response should contain non-expired items.'
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is off here, and in the changes further down in this file.

Not sure why this isn't caught by the linter, but please fix it. We'll have to see what's up with the linting rules.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@techanvil Fixed. I identified the issue with the linter and opened an issue here: #12934.

Comment on lines +368 to +372
$this->assertEqualSets(
array( $shared_admin, $shared_editor ),
wp_list_pluck( $this->query->get_eligible_users( $current_admin, array( 'per_page' => 20 ) ), 'ID' ),
'Eligible users should include deduplicated users.'
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another indentation issue here, and below.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@techanvil Fixed, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants