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

Move Constraint validator test case to Test namespace#17203

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

Conversation

@wouterj
Copy link
Member

QA
Bug fix?no
New feature?kinda
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

The Validator component has a very usefull test utility to test constraint validators. It's only hidden deep in the Tests namespace. Just as was done with the TypeTestCase of the Form component some years ago, I think it's usefull to move the constraint test case to the Test namespace as well.

Btw, my last PR of the year and the first deprecation of 3.1 🎆

Copy link
Member

Choose a reason for hiding this comment

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

missing silencing

Copy link
Member

Choose a reason for hiding this comment

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

and it cannot be removed in 3.0...

@wouterjwouterjforce-pushed thevalidator-move_constraint_test branch from30ea9a3 tocbf1f77CompareDecember 31, 2015 17:29
@wouterj
Copy link
MemberAuthor

Thanks for your quick review,@stof! I've fixed the PR now.

@Tobion
Copy link
Contributor

We do not maintain BC for test files inTests namespace. So these deprecations are not needed.

@nicolas-grekas
Copy link
Member

I agree with@Tobion, no need to preserve BC for tests
Status: needs work

@stof
Copy link
Member

Well, given that some tests are using this class in other components, we would have to preserve BC (and people might use it elsewhere too already). The point is that this base testcase is meant to be extended when writing tests. We just messed up its location when introducing it (and this is the drawback of the inclusion of tests inside the runtime, as our testsuite is autoloadable by any code installing the component as a dependency)
We were maintaining BC for similar base testcases in the Form component in 2.x

Choose a reason for hiding this comment

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

This is an issue: we won't test the bridge with symfony/validator anymore, which could hide BC breaks.
We need to find a way to keep ~2.8 here.
(same comment for the other cases below)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Why wouldn't this test the bridge with symfony/validator anymore? It would simply be tested against 3.1, or am I missing something?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@nicolas-grekas Can you give us more insights about this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the point is that the test suite tests both against the highest and lowest possible dependencies. Since 3.1 is the minimum boundary, even the--prefer-lowest tests will run against 3.1 and not against 2.8, which might hide compatibility issues.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

So the solution would be to keep both classes (new and old) and use the old one in the core libraries, so we can still properly support and test 2.8 and 3.0?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that would be good, yes.

@nicolas-grekas
Copy link
Member

@stof, then I suggest to NOT deprecate anything in this PR

@stof
Copy link
Member

@nicolas-grekas I don't understand what you mean. Do you suggest moving the class without deprecating the old class name ?

@nicolas-grekas
Copy link
Member

@stof yes, that's the best idea I have for now to still allow ~2.8 in composer json files...

@fabpot
Copy link
Member

I think we are going too far with BC. Files underTests are internal and private. Let's move the file and not care about BC here.

@wouterjwouterjforce-pushed thevalidator-move_constraint_test branch fromcbf1f77 to5c516d8CompareJanuary 25, 2016 14:10
@wouterj
Copy link
MemberAuthor

Alright, removed the class and file.

@fabpot
Copy link
Member

@nicolas-grekas The only remaining issue is the composer deps changes
@wouterj Can you rebase?

@wouterjwouterjforce-pushed thevalidator-move_constraint_test branch from5c516d8 to5eeb754CompareFebruary 29, 2016 19:14
@wouterj
Copy link
MemberAuthor

Rebased

Status: Needs review

UPGRADE FROM 3.0 to 3.1
=======================

<<<<<<< HEAD
Copy link
Member

Choose a reason for hiding this comment

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

Conflict resolution issue

@wouterjwouterjforce-pushed thevalidator-move_constraint_test branch from5eeb754 tod4ff6ffCompareFebruary 29, 2016 20:04
@wouterj
Copy link
MemberAuthor

Thanks, fixed your comments@stof.

@xabbuh
Copy link
Member

This seems to need a rebase again.

// ...
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

class MyCustomValidatorTest extends ConstraintValidatorTestCase
Copy link
Contributor

Choose a reason for hiding this comment

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

Did we move away from prefixing abstract classes withAbstract (in general)?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Hmm, I'm not sure actually. But it seems to be more common to not add the prefix for abstract classes in Symfony.

@fabpot
Copy link
Member

@wouterj IIUC, it would be better to keepAbstractConstraintValidatorTest.php for now along side the new one and keep 2.8 as the min requirement. Is that correct@nicolas-grekas? If yes, let's do this and merge.

@wouterjwouterjforce-pushed thevalidator-move_constraint_test branch fromd4ff6ff toed33a2dCompareJune 15, 2016 09:42
@wouterj
Copy link
MemberAuthor

Updated the PR to keep both classes and deprecate the old one. We can't trigger a deprecation warning, as we can't update all core packages to use the new class.

@wouterjwouterjforce-pushed thevalidator-move_constraint_test branch fromed33a2d to0e868eeCompareJune 15, 2016 09:44
@wouterjwouterjforce-pushed thevalidator-move_constraint_test branch from0e868ee toe938361CompareJune 15, 2016 14:32
@fabpot
Copy link
Member

Thank you@wouterj.

wouterj reacted with hooray emoji

@fabpotfabpot merged commite938361 intosymfony:masterJun 15, 2016
fabpot added a commit that referenced this pull requestJun 15, 2016
…(WouterJ)This PR was merged into the 3.2-dev branch.Discussion----------Move Constraint validator test case to Test namespace| Q             | A| ------------- | ---| Bug fix?      | no| New feature?  | kinda| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -The Validator component has a very usefull test utility to test constraint validators. It's only hidden deep in the Tests namespace. Just as was done with the TypeTestCase of the Form component some years ago, I think it's usefull to move the constraint test case to the Test namespace as well.*Btw, my last PR of the year and the first deprecation of 3.1* 🎆Commits-------e938361 Move Constraint validator test case to Test namespace
@wouterjwouterj deleted the validator-move_constraint_test branchJune 15, 2016 21:42
@fabpotfabpot mentioned this pull requestOct 27, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

9 participants

@wouterj@Tobion@nicolas-grekas@stof@fabpot@xabbuh@webmozart@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp