Skip to content
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 hex-color validator and add unit tests for the validation rules #42

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

jeyemwey
Copy link
Contributor

@jeyemwey jeyemwey commented Oct 3, 2023

This PR adds a validation rule for the color fields which should always be 6-digit hex codes with a # in front (inspired by #40). Turns out there were even more cases where that wasn't set properly!

Since the validation rules are getting more and more complex, I've added a very barebones unit test framework which can cross-check if the rules are doing what we want them to. This turned out to be the larger part of this PR.

Hope it's alright for y'all and hopefully this can add to a better data quality overall.

Copy link
Member

@MrKrisKrisu MrKrisKrisu left a comment

Choose a reason for hiding this comment

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

nice!

@MrKrisKrisu MrKrisKrisu assigned jeyemwey and unassigned MrKrisKrisu Oct 4, 2023
For this, some validation functions are extracted out to common.php and
unit test cases are described.
@jeyemwey jeyemwey merged commit 4f2243b into main Oct 4, 2023
@jeyemwey jeyemwey deleted the jv-validator2 branch October 4, 2023 14:22
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