File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -31,15 +31,26 @@ public function testLoadClassMetadataReturnsFalseIfEmpty()
31
31
$ this ->assertFalse ($ loader ->loadClassMetadata ($ metadata ));
32
32
}
33
33
34
- public function testLoadClassMetadataThrowsExceptionIfNotAnArray ()
34
+ /**
35
+ * @dataProvider provideInvalidYamlFiles
36
+ * @expectedException \InvalidArgumentException
37
+ */
38
+ public function testInvalidYamlFiles ($ path )
35
39
{
36
- $ loader = new YamlFileLoader (__DIR__ .'/nonvalid-mapping.yml ' );
40
+ $ loader = new YamlFileLoader (__DIR__ .'/ ' . $ path );
37
41
$ metadata = new ClassMetadata ('Symfony\Component\Validator\Tests\Fixtures\Entity ' );
38
42
39
- $ this ->setExpectedException ('\InvalidArgumentException ' );
40
43
$ loader ->loadClassMetadata ($ metadata );
41
44
}
42
45
46
+ public function provideInvalidYamlFiles ()
47
+ {
48
+ return array (
49
+ array ('nonvalid-mapping.yml ' ),
50
+ array ('bad-format.yml ' ),
51
+ );
52
+ }
53
+
43
54
/**
44
55
* @see https://github.com/symfony/symfony/pull/12158
45
56
*/
Original file line number Diff line number Diff line change
1
+ namespaces :
2
+ custom : Symfony\Component\Validator\Tests\Fixtures\
3
+
4
+ Symfony\Component\Validator\Tests\Fixtures\Entity :
5
+ constraints :
6
+ # Custom constraint
7
+ - Symfony\Component\Validator\Tests\Fixtures\ConstraintA : ~
8
+ # Custom constraint with namespaces prefix
9
+ - "custom:ConstraintB" : ~
You can’t perform that action at this time.
0 commit comments