|
19 | 19 | use Symfony\Component\Validator\Constraints\Choice;
|
20 | 20 | use Symfony\Component\Validator\Constraints\Collection;
|
21 | 21 | use Symfony\Component\Validator\Constraints\Email;
|
| 22 | +use Symfony\Component\Validator\Constraints\Expression; |
22 | 23 | use Symfony\Component\Validator\Constraints\IsTrue;
|
23 | 24 | use Symfony\Component\Validator\Constraints\NotBlank;
|
24 | 25 | use Symfony\Component\Validator\Constraints\NotNull;
|
@@ -65,6 +66,9 @@ public function testLoadClassMetadata(string $namespace)
|
65 | 66 | $expected->setGroupSequence(['Foo', 'Entity']);
|
66 | 67 | $expected->addConstraint(new ConstraintA());
|
67 | 68 | $expected->addConstraint(new Callback(['Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback']));
|
| 69 | + $expected->addConstraint(new Sequentially([ |
| 70 | + new Expression('this.getFirstName() != null'), |
| 71 | + ])); |
68 | 72 | $expected->addConstraint(new Callback(['callback' => 'validateMe', 'payload' => 'foo']));
|
69 | 73 | $expected->addConstraint(new Callback('validateMeStatic'));
|
70 | 74 | $expected->addPropertyConstraint('firstName', new NotNull());
|
@@ -151,6 +155,9 @@ public function testLoadClassMetadataAndMerge(string $namespace)
|
151 | 155 | $expected->setGroupSequence(['Foo', 'Entity']);
|
152 | 156 | $expected->addConstraint(new ConstraintA());
|
153 | 157 | $expected->addConstraint(new Callback(['Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback']));
|
| 158 | + $expected->addConstraint(new Sequentially([ |
| 159 | + new Expression('this.getFirstName() != null'), |
| 160 | + ])); |
154 | 161 | $expected->addConstraint(new Callback(['callback' => 'validateMe', 'payload' => 'foo']));
|
155 | 162 | $expected->addConstraint(new Callback('validateMeStatic'));
|
156 | 163 | $expected->addPropertyConstraint('firstName', new NotNull());
|
|
0 commit comments