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

Update phone validation regex to accept only numbers and correct amount - Fix "must consist of only numbers" validation error message to be specific #112

Open
wants to merge 40 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8f13d54
Update phone validation regex to accept only numbers and correct amount
MaxwellGarceau Jan 3, 2025
c4030e1
Strip whitespace from beginning, middle, and end of phone number
MaxwellGarceau Jan 3, 2025
5039d05
Add custom message for not enough digits
MaxwellGarceau Jan 4, 2025
80d47ea
Refactor if else ladder to switch statement for readability
MaxwellGarceau Jan 4, 2025
e7b69ad
Add back translators. Fix linting.
MaxwellGarceau Jan 4, 2025
1e84eab
Add comment
MaxwellGarceau Jan 4, 2025
f6d7d2d
Replace arrow function with anonymous function for php compatibility
MaxwellGarceau Jan 7, 2025
d809da1
Add phpunit, wp_mock, and scaffold
MaxwellGarceau Jan 7, 2025
20111b3
Modularize validate phone number
MaxwellGarceau Jan 7, 2025
e6fcce1
Rename function to follow 10up namespace standards
MaxwellGarceau Jan 7, 2025
909778a
Move address validation to validation module
MaxwellGarceau Jan 7, 2025
209f1c5
Rename mailchimp_sf_merge_validate_address to merge_validate_address
MaxwellGarceau Jan 7, 2025
0563c38
Debug phpunit tests
MaxwellGarceau Jan 7, 2025
db37116
Rename test
MaxwellGarceau Jan 7, 2025
4f30589
Modularize location detection class
MaxwellGarceau Jan 7, 2025
670e453
Add commands to lint for compatibility and autofix lint errors
MaxwellGarceau Jan 7, 2025
530b6a3
Add helper function to create WP_Error
MaxwellGarceau Jan 8, 2025
ad1c36e
Define MCSF_DIR and MCSF_URL constants for testing
MaxwellGarceau Jan 8, 2025
988670f
First pass of us phone number validation tests
MaxwellGarceau Jan 8, 2025
68af8f0
Refactor merge validation into a class for testing
MaxwellGarceau Jan 8, 2025
d86f954
Add WP_Error factory for ease of unit testing
MaxwellGarceau Jan 8, 2025
71edf9e
Update testInvalidPhoneNumbers with WP_Error factory
MaxwellGarceau Jan 8, 2025
2a7a68f
Refactor validation to use class constants for error codes
MaxwellGarceau Jan 8, 2025
2801d6d
Update tests to use WP_Error factory logic
MaxwellGarceau Jan 8, 2025
fc3b09f
Remove test for long phone numbers
MaxwellGarceau Jan 8, 2025
6168b0e
Adding more testing cases for invalid phone numbers and too short num…
MaxwellGarceau Jan 8, 2025
ed690a5
Fix invalid number test case
MaxwellGarceau Jan 8, 2025
040eb86
Declare strict types in validate
MaxwellGarceau Jan 8, 2025
69ac558
Fix lint error
MaxwellGarceau Jan 8, 2025
425e524
Formatting adjustments
MaxwellGarceau Jan 8, 2025
43571b3
Add phpcompatibility most recent sniffs
MaxwellGarceau Jan 8, 2025
abc8ca1
Fix bug causing form to not submit on empty US phone numbers
MaxwellGarceau Jan 8, 2025
69e2b5d
Phone number should be exactly 12 digits
MaxwellGarceau Jan 8, 2025
991dba4
Update tests to ensure empty and falsy inputs return null
MaxwellGarceau Jan 8, 2025
5ad101d
Add back original validation functions as deprecated
MaxwellGarceau Jan 9, 2025
7df134f
Add docblock comment to deprecated-functions.php
MaxwellGarceau Jan 9, 2025
c15dfc0
Fix deprecation warnings on test
MaxwellGarceau Jan 9, 2025
bcc6b2e
Add _deprecate_function to mailchimp_sf_merge_validate_phone and mail…
MaxwellGarceau Jan 15, 2025
305ac72
Add mailchimp_sf_where_am_i back as a deprecated function
MaxwellGarceau Jan 15, 2025
ed22e15
Fix lint
MaxwellGarceau Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
},
"require-dev": {
"10up/phpcs-composer": "^3.0",
"sirbrillig/phpcs-changed": "^2.11"
"sirbrillig/phpcs-changed": "^2.11",
"yoast/phpunit-polyfills": "^3.0",
"10up/wp_mock": "^0.4.2",
"phpcompatibility/php-compatibility": "dev-develop as 9.99.99"
},
"autoload": {
"psr-4": {
Expand All @@ -32,6 +35,9 @@
}
},
"scripts": {
"lint": "phpcs --standard=./phpcs.xml -p -s ."
"lint": "phpcs --standard=./phpcs.xml -p -s .",
"lint:fix": "phpcbf --standard=./phpcs.xml -p -s .",
"lint:compat": "phpcs --standard=./phpcs-compat.xml -p -s .",
"test": "vendor/bin/phpunit"
}
}
Loading
Loading