Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Validator] Add tests forMacAddress#60422

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:7.2fromtcoch:7.3
May 30, 2025
Merged

Conversation

tcoch
Copy link

@tcochtcoch commentedMay 14, 2025
edited by nicolas-grekas
Loading

QA
Branch?7.2
Bug fix?no
New feature?no
Deprecations?no
Issues-
LicenseMIT

This PR aims to add some tests to the MacAddress Validator.

[x] Add testing for empty string and null values Already handled withtestNullIsValid andtestEmptyStringIsValid methods
[x] Add testing of unvalid mac addresses
[x] Create generic methodassertViolation() inConstraintValidatorTestCase.php to test that unvalid values do throw a violation. See conversation below

If this PR is accepted, I'll try to continue this work on other validators. I believe testing empty string and null values is important to ensure no BC occurs, for example.

@carsonbotcarsonbot added this to the7.3 milestoneMay 14, 2025
@carsonbotcarsonbot changed the title[VALIDATOR] Add tests for MAC Address[Validator] Add tests for MAC AddressMay 14, 2025
Copy link
Member

@stofstof left a comment

Choose a reason for hiding this comment

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

-1 for addingassertViolation. We should encourage using the existingexpectViolationsAt orbuildViolation() methods to define precise expected violations instead.

@tcochtcoch requested a review fromstofMay 20, 2025 12:50
@OskarStarkOskarStark changed the title[Validator] Add tests for MAC Address[Validator] Add tests forMacAddressMay 20, 2025
@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
@nicolas-grekasnicolas-grekas modified the milestones:7.4,7.2May 30, 2025
@nicolas-grekas
Copy link
Member

Thank you@tcoch.

@nicolas-grekasnicolas-grekas merged commit6b4fced intosymfony:7.2May 30, 2025
10 of 11 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@stofstofAwaiting requested review from stof

@xabbuhxabbuhAwaiting requested review from xabbuh

@lyrixxlyrixxAwaiting requested review from lyrixx

@ycerutoycerutoAwaiting requested review from yceruto

@welcoMatticwelcoMatticAwaiting requested review from welcoMattic

@kbondkbondAwaiting requested review from kbond

@chalasrchalasrAwaiting requested review from chalasr

@dunglasdunglasAwaiting requested review from dunglas

@OskarStarkOskarStarkAwaiting requested review from OskarStark

@jderussejderusseAwaiting requested review from jderusse

Assignees
No one assigned
Projects
None yet
Milestone
7.2
Development

Successfully merging this pull request may close these issues.

5 participants
@tcoch@nicolas-grekas@stof@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp