Opened 6 weeks ago
Last modified 2 weeks ago
#66223 new defect (bug)
Add tests for wp_admin_bar_shortlink_menu
| Reported by: | r1k0 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: | tests |
Description
Checks when the shortlink exists and when it doesn't.
Change History (10)
This ticket was mentioned in PR #13883 on WordPress/wordpress-develop by @r1k0.
6 weeks ago
#1
- Keywords has-patch has-unit-tests added
@mukesh27 commented on PR #13883:
6 weeks ago
#2
Tests with multiple assertions are missing the message parameter.
@r1k0 commented on PR #13883:
6 weeks ago
#3
Updated
@r1k0 commented on PR #13883:
6 weeks ago
#4
Updated with suggested changes
@r1k0 commented on PR #13883:
6 weeks ago
#5
Updated
#6
@
6 weeks ago
Tested PR #13883 for ticket #66223.
Environment:
- WordPress trunk (7.2-alpha)
- PHP 8.3.26
- PHPUnit 9.6.37
- Windows 10 / Docker
- Single site
Test command:
npm run test:php -- --filter wp_admin_bar_shortlink_menu
Result:
PASS
Both tests passed successfully:
2 tests, 7 assertions.
The tests cover the shortlink empty and shortlink available scenarios as described in the ticket.
@r1k0 commented on PR #13883:
6 weeks ago
#7
Thank you for the review.
Updated with suggested changes and add the special characters tests.
@r1k0 commented on PR #13883:
6 weeks ago
#8
Thank you again @mukeshpanchal27. Applied all the changes suggested.
Re-run the tests and they are all passing.
@lancewillett commented on PR #13883:
2 weeks ago
#10
PR #13883 landed in https://core.trac.wordpress.org/changeset/65105
Tests when shortlink when shortlink doesn't exists and when it does.
Trac ticket: #66223
Use of AI Tools
AI assistance: Yes
Tool(s): ChatGPT
Used for: Initial code skeleton and test suggestions; final implementation and tests were reviewed and edited by me.