Make WordPress Core

Opened 10 years ago

Last modified 7 weeks ago

#31313 new enhancement

refactor is_email() tests to use separate data files and PHPUnit dataProvider

Reported by: salcode's profile salcode Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: is-email has-patch has-unit-tests
Focuses: Cc:

Description

There are a number of open tickets involving email validation that seem as though they could benefit from making the tests on is_email() a little more robust.

This is my first pass at that.

Ultimately, I think moving the dataProvider out of IsEmail.php would be helpful so it could be re-used when adding tests for sanitize_email(), but I wanted to take this one step at a time.

I'm relatively new to automated testing and very open to suggestions.

Related: #17433, #17491, #21730, #25108, #30039

Attachments (1)

refactor-is-email-tests.diff (3.2 KB) - added by salcode 10 years ago.

Download all attachments as: .zip

Change History (7)

#1 @iseulde
10 years ago

  • Component changed from General to Formatting
  • Version trunk deleted

#2 @miqrogroove
10 years ago

  • Keywords is-email added

#3 @swissspidy
10 years ago

  • Component changed from Formatting to Build/Test Tools
  • Keywords has-patch needs-refresh added

Using data providers makes sense, though separate files are probably not needed for that.

#4 @swissspidy
8 years ago

  • Milestone changed from Awaiting Review to Future Release

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


7 weeks ago
#5

  • Keywords has-unit-tests added; needs-refresh removed

This PR updates the is_email() tests to improve structure and maintainability by utilizing PHPUnit's dataProvider

Trac ticket: https://core.trac.wordpress.org/ticket/31313

#6 @geekofshire
7 weeks ago

Hey everyone,

I noticed that this ticket has been open for quite a while, and I wanted to help move it forward. I've refactored the is_email() tests to use dataProvider while keeping all test data in the same file for better maintainability. Let me know if there’s any feedback or if anything else needs to be updated!

Thanks!

Note: See TracTickets for help on using tickets.