Skip to content

Chore: Improve canonical email test for proton case insensitive mails#20

Closed
Meldiron wants to merge 1 commit into
mainfrom
chore-improve-tests
Closed

Chore: Improve canonical email test for proton case insensitive mails#20
Meldiron wants to merge 1 commit into
mainfrom
chore-improve-tests

Conversation

@Meldiron
Copy link
Copy Markdown
Contributor

No description provided.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 20, 2026

Greptile Summary

This PR adds test cases to cover case-insensitive canonicalisation of ProtonMail addresses, specifically verifying that mixed- and upper-case local parts are lowercased and that proton.me / pm.me aliases are normalised to protonmail.com.

  • ProtonmailTest.php: Three new direct-provider tests (mixed, upper, lower) correctly verify that getCanonical() lowercases the local part regardless of input casing.
  • EmailTest.php: A baseline proton.me case is added to the regular block, and three case-variant entries are added to the case-insensitive block; the third entry in the case-insensitive group is all-lowercase and duplicates the regular-block entry rather than following the lowercase-local + mixed-domain pattern used by every other provider.

Confidence Score: 4/5

Safe to merge; all changes are test-only additions with no production code impact.

The only change is in test files, and the tests themselves are correct — they accurately describe the expected behaviour. The one inconsistency (the third case-insensitive entry being all-lowercase instead of following the mixed-domain pattern) is cosmetic and doesn't risk a false-positive or false-negative test result.

tests/EmailTest.php — the third entry in the new proton.me case-insensitive group.

Important Files Changed

Filename Overview
tests/Canonicals/Providers/ProtonmailTest.php Adds three case-sensitivity test cases (mixed, upper, lower) for the local part of a proton.me address; changes are correct and consistent with the existing test structure.
tests/EmailTest.php Adds proton.me case-insensitive test cases in two sections; the third entry in the case-insensitive block is all-lowercase and duplicates the entry added in the regular section, which breaks the established UPPERCASE/MixedCase/mixed-domain-lowercase-local pattern used by every other provider.

Reviews (1): Last reviewed commit: "add proton mail case sensitiity test for..." | Re-trigger Greptile

Comment thread tests/EmailTest.php
Comment on lines +737 to +739
['MYMAIL777@PROTON.ME', 'mymail777@protonmail.com'],
['MyMail777@Proton.Me', 'mymail777@protonmail.com'],
['mymail777@proton.me', 'mymail777@protonmail.com'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 The third entry in this group is all-lowercase (mymail777@proton.me), so it doesn't exercise any case normalisation — it is identical to the test added at line 564 in the regular block. Every other provider's three-entry group in this section follows the pattern UPPERCASE / MixedCase / lowercase-local+mixed-domain (e.g. user.name+tag@Protonmail.com). Using mymail777@Proton.Me as the third variant would stay consistent with that pattern and actually verify domain-case folding.

Suggested change
['MYMAIL777@PROTON.ME', 'mymail777@protonmail.com'],
['MyMail777@Proton.Me', 'mymail777@protonmail.com'],
['mymail777@proton.me', 'mymail777@protonmail.com'],
['MYMAIL777@PROTON.ME', 'mymail777@protonmail.com'],
['MyMail777@Proton.Me', 'mymail777@protonmail.com'],
['mymail777@Proton.Me', 'mymail777@protonmail.com'],

@Meldiron Meldiron closed this May 20, 2026
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.

1 participant