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()
3131 $ this ->assertFalse ($ loader ->loadClassMetadata ($ metadata ));
3232 }
3333
34- public function testLoadClassMetadataThrowsExceptionIfNotAnArray ()
34+ /**
35+ * @dataProvider provideInvalidYamlFiles
36+ * @expectedException \InvalidArgumentException
37+ */
38+ public function testInvalidYamlFiles ($ path )
3539 {
36- $ loader = new YamlFileLoader (__DIR__ .'/nonvalid-mapping.yml ' );
40+ $ loader = new YamlFileLoader (__DIR__ .'/ ' . $ path );
3741 $ metadata = new ClassMetadata ('Symfony\Component\Validator\Tests\Fixtures\Entity ' );
3842
39- $ this ->setExpectedException ('\InvalidArgumentException ' );
4043 $ loader ->loadClassMetadata ($ metadata );
4144 }
4245
46+ public function provideInvalidYamlFiles ()
47+ {
48+ return array (
49+ array ('nonvalid-mapping.yml ' ),
50+ array ('bad-format.yml ' ),
51+ );
52+ }
53+
4354 /**
4455 * @see https://github.com/symfony/symfony/pull/12158
4556 */
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