Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function parseConstraints(\SimpleXMLElement $nodes)
$options = array();
}
} elseif (strlen((string) $node) > 0) {
$options = trim($node);
$options = XmlUtils::phpize(trim($node));
} else {
$options = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Symfony\Component\Validator\Constraints\Range;
use Symfony\Component\Validator\Constraints\Regex;
use Symfony\Component\Validator\Constraints\IsTrue;
use Symfony\Component\Validator\Constraints\Traverse;
use Symfony\Component\Validator\Exception\MappingException;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Mapping\Loader\XmlFileLoader;
Expand Down Expand Up @@ -57,6 +58,7 @@ public function testLoadClassMetadata()
$expected->addConstraint(new Callback('validateMe'));
$expected->addConstraint(new Callback('validateMeStatic'));
$expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback')));
$expected->addConstraint(new Traverse(false));
$expected->addPropertyConstraint('firstName', new NotNull());
$expected->addPropertyConstraint('firstName', new Range(array('min' => 3)));
$expected->addPropertyConstraint('firstName', new Choice(array('A', 'B')));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
<value>callback</value>
</constraint>

<!-- Traverse with boolean default option -->
<constraint name="Traverse">
false
</constraint>

<!-- PROPERTY CONSTRAINTS -->

<property name="firstName">
Expand Down