Symfony2: Testing entity validation constraints

后端 未结 7 1193
南旧
南旧 2020-12-07 16:35

Does anyone have a good way to unit test an entity\'s validation constraints in Symfony2?

Ideally I want to have access to the Dependency Injection Container within

相关标签:
7条回答
  • 2020-12-07 17:25

    The answer in https://stackoverflow.com/a/41884661/4560833 has to be changed a little for Symfony 4:

    Use ConstraintValidatorTestCase instead of AbstractConstraintValidatorTest.

    0 讨论(0)
提交回复
热议问题