1
1
<?php
2
2
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
3
12
namespace Symfony \Bridge \Doctrine \Tests \Form \Validation ;
4
13
5
14
use Doctrine \ORM \EntityManager ;
6
- use Doctrine \ORM \Tools \SchemaTool ;
7
15
use Doctrine \Persistence \ManagerRegistry ;
8
16
use PHPUnit \Framework \MockObject \MockObject ;
9
- use Symfony \Bridge \Doctrine \Form \DoctrineOrmExtension ;
10
17
use Symfony \Bridge \Doctrine \Tests \DoctrineTestHelper ;
11
18
use Symfony \Bridge \Doctrine \Tests \Fixtures \UniqueFieldFormValidationEntity ;
12
- use Symfony \Bridge \Doctrine \Tests \Fixtures \UniqueGroupFieldsEntity ;
13
19
use Symfony \Bridge \Doctrine \Validator \Constraints \UniqueEntity ;
14
20
use Symfony \Bridge \Doctrine \Validator \Constraints \UniqueEntityValidator ;
15
21
use Symfony \Component \Form \Extension \Validator \ValidatorExtension ;
16
22
use Symfony \Component \Form \Extension \Validator \ViolationMapper \ViolationMapper ;
17
- use Symfony \Component \Form \Forms ;
18
- use Symfony \Component \Form \Tests \Extension \Core \Type \BaseTypeTestCase ;
23
+ use Symfony \Component \Form \Test \TypeTestCase ;
19
24
use Symfony \Component \Form \Tests \Extension \Core \Type \FormTypeTest ;
20
25
use Symfony \Component \Form \Tests \Extension \Core \Type \TextTypeTest ;
21
26
use Symfony \Component \Validator \ConstraintValidatorFactory ;
22
27
use Symfony \Component \Validator \ConstraintViolation ;
23
28
use Symfony \Component \Validator \Validation ;
24
- use Symfony \Component \Form \Test \TypeTestCase ;
25
29
26
30
class UniqueFieldEntityFormValidationTest extends TypeTestCase
27
31
{
@@ -46,10 +50,11 @@ protected function createRegistryMock($name, $em): MockObject&ManagerRegistry
46
50
47
51
return $ registry ;
48
52
}
53
+
49
54
protected function getExtensions (): array
50
55
{
51
56
$ factory = new ConstraintValidatorFactory ([
52
- 'doctrine.orm.validator.unique ' => new UniqueEntityValidator ($ this ->emRegistry )
57
+ 'doctrine.orm.validator.unique ' => new UniqueEntityValidator ($ this ->emRegistry ),
53
58
]);
54
59
55
60
$ validator = Validation::createValidatorBuilder ()
0 commit comments