|
17 | 17 | use Symfony\Component\DependencyInjection\Exception\LogicException;
|
18 | 18 | use Symfony\Component\DependencyInjection\Exception\OutOfBoundsException;
|
19 | 19 | use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
|
| 20 | +use Symfony\Component\Validator\Constraints\Email; |
20 | 21 | use Symfony\Component\Workflow\Exception\InvalidDefinitionException;
|
21 | 22 |
|
22 | 23 | class PhpFrameworkExtensionTest extends FrameworkExtensionTestCase
|
@@ -265,4 +266,31 @@ public function testRateLimiterIsTagged()
|
265 | 266 | $this->assertSame('first', $container->getDefinition('limiter.first')->getTag('rate_limiter')[0]['name']);
|
266 | 267 | $this->assertSame('second', $container->getDefinition('limiter.second')->getTag('rate_limiter')[0]['name']);
|
267 | 268 | }
|
| 269 | + |
| 270 | + /** |
| 271 | + * @dataProvider emailValidationModeProvider |
| 272 | + */ |
| 273 | + public function testValidatorEmailValidationMode(string $mode) |
| 274 | + { |
| 275 | + $this->expectNotToPerformAssertions(); |
| 276 | + |
| 277 | + $this->createContainerFromClosure(function (ContainerBuilder $container) use ($mode) { |
| 278 | + $container->loadFromExtension('framework', [ |
| 279 | + 'annotations' => false, |
| 280 | + 'http_method_override' => false, |
| 281 | + 'handle_all_throwables' => true, |
| 282 | + 'php_errors' => ['log' => true], |
| 283 | + 'validation' => [ |
| 284 | + 'email_validation_mode' => $mode, |
| 285 | + ], |
| 286 | + ]); |
| 287 | + }); |
| 288 | + } |
| 289 | + |
| 290 | + public function emailValidationModeProvider() |
| 291 | + { |
| 292 | + foreach (Email::VALIDATION_MODES as $mode) { |
| 293 | + yield [$mode]; |
| 294 | + } |
| 295 | + } |
268 | 296 | }
|
0 commit comments