Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#61080 closed defect (bug) (fixed)

HTML API: Tests should use expectedIncorrectUsage phpunit annotation

Reported by: jonsurrell's profile jonsurrell Owned by: jonsurrell's profile jonsurrell
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: HTML API Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

Some tests in the HTML API test suite use setExpectedIncorrectUsage. The annotation @expectedIncorrectUsage can be used to simplify the tests.

Change History (5)

This ticket was mentioned in PR #6449 on WordPress/wordpress-develop by @jonsurrell.


8 months ago
#1

  • Keywords has-patch has-unit-tests added

@dmsnell commented on PR #6449:


8 months ago
#2

When I added a commit to prevent calling _doing_it_wrong() the test didn't fail locally, but it did mark it as risky, which I believe is because it makes no assertions.

https://github.com/WordPress/wordpress-develop/assets/5431237/248726b9-711e-4f97-a1a8-064f4437b1da

Thankfully, the CI job failed.

https://github.com/WordPress/wordpress-develop/assets/5431237/e5004734-3c49-4208-956a-fbe92871cc60

That pretty-much confirms what I wanted to know, so I'll remove my commit and we should be able to merge this.

#3 @dmsnell
8 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 58048:

HTML API: Tests should use expectedIncorrectUsage phpunit annotation

Some tests in the HTML API test suite use setExpectedIncorrectUsage.
The annotation @expectedIncorrectUsage can be used to simplify the tests.

Developed in https://github.com/WordPress/wordpress-develop/pull/6449
Discussed in https://core.trac.wordpress.org/ticket/61080

Fixes #61080.
Props dmsnell, jonsurrell.

#4 @dmsnell
8 months ago

  • Milestone changed from Awaiting Review to 6.6
Note: See TracTickets for help on using tickets.