-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add PHPUnit tests for wp_parse_id_list function #5851
Conversation
A new PHPUnit test file for the 'wp_parse_id_list' function is introduced. It includes various scenarios ranging from plain numbers, strings with spaces, and HTML to strings with commas. This is crucial to guarantee the function's accurate response to a variety of inputs, enhancing software reliability and stability.
The variable 'list' was renamed to 'input_list' for clarify and a new test case 'dup_id' was added. The new test case will further enhance test coverage by handling an additional scenario where there are duplicate identifiers in the input list.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
* @ticket 60218 | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @ticket 60218 | |
* |
No needs to add @ticket
annotation for Data Provider.
} | ||
|
||
/** | ||
* data for test_wp_parse_id_list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* data for test_wp_parse_id_list | |
* Data provider for test_wp_parse_id_list(). |
* @dataProvider data_wp_parse_id_list | ||
*/ | ||
public function test_wp_parse_id_list( $input_list, $expected ) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Merged as part of r57737. |
A new PHPUnit test file for the 'wp_parse_id_list' function is introduced. It includes various scenarios ranging from plain numbers, strings with spaces, and HTML to strings with commas. This is crucial to guarantee the function's accurate response to a variety of inputs, enhancing software reliability and stability.
Trac ticket: https://core.trac.wordpress.org/ticket/60218