public function XmlFileLoaderTest::testLoadClassMetadataWithNonStrings in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/validator/Tests/Mapping/Loader/XmlFileLoaderTest.php \Symfony\Component\Validator\Tests\Mapping\Loader\XmlFileLoaderTest::testLoadClassMetadataWithNonStrings()
File
- vendor/
symfony/ validator/ Tests/ Mapping/ Loader/ XmlFileLoaderTest.php, line 80
Class
Namespace
Symfony\Component\Validator\Tests\Mapping\LoaderCode
public function testLoadClassMetadataWithNonStrings() {
$loader = new XmlFileLoader(__DIR__ . '/constraint-mapping-non-strings.xml');
$metadata = new ClassMetadata('Symfony\\Component\\Validator\\Tests\\Fixtures\\Entity');
$loader
->loadClassMetadata($metadata);
$expected = new ClassMetadata('Symfony\\Component\\Validator\\Tests\\Fixtures\\Entity');
$expected
->addPropertyConstraint('firstName', new Regex(array(
'pattern' => '/^1/',
'match' => false,
)));
$properties = $metadata
->getPropertyMetadata('firstName');
$constraints = $properties[0]
->getConstraints();
$this
->assertFalse($constraints[0]->match);
}