File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 7
7
use InvalidArgumentException ;
8
8
use PHPUnit \Framework \TestCase ;
9
9
use Symfony \Component \Validator \Constraints \NotBlank ;
10
+ use Symfony \Component \Validator \Constraints \Required ;
10
11
11
12
/**
12
13
* @coversDefaultClass \DigitalRevolution\SymfonyRequestValidation\ValidationRules
@@ -24,6 +25,17 @@ public function testConstructorAndGetters(): void
24
25
static ::assertSame ($ definitions , $ rules ->getDefinitions ());
25
26
}
26
27
28
+ /**
29
+ * @covers ::__construct
30
+ * @covers ::getDefinitions
31
+ */
32
+ public function testConstructorArrayOfConstraints (): void
33
+ {
34
+ $ definitions = ['query ' => [new Required (), new NotBlank ()]];
35
+ $ rules = new ValidationRules ($ definitions );
36
+ static ::assertSame ($ definitions , $ rules ->getDefinitions ());
37
+ }
38
+
27
39
/**
28
40
* @covers ::__construct
29
41
*/
You can’t perform that action at this time.
0 commit comments