class ConstraintViolationTest in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/validator/Tests/ConstraintViolationTest.php \Symfony\Component\Validator\Tests\ConstraintViolationTest
Hierarchy
- class \Symfony\Component\Validator\Tests\ConstraintViolationTest extends \Symfony\Component\Validator\Tests\PHPUnit_Framework_TestCase
Expanded class hierarchy of ConstraintViolationTest
File
- vendor/
symfony/ validator/ Tests/ ConstraintViolationTest.php, line 16
Namespace
Symfony\Component\Validator\TestsView source
class ConstraintViolationTest extends \PHPUnit_Framework_TestCase {
public function testToStringHandlesArrays() {
$violation = new ConstraintViolation('Array', '{{ value }}', array(
'{{ value }}' => array(
1,
2,
3,
),
), 'Root', 'property.path', null);
$expected = <<<EOF
Root.property.path:
Array
EOF;
$this
->assertSame($expected, (string) $violation);
}
public function testToStringHandlesArrayRoots() {
$violation = new ConstraintViolation('42 cannot be used here', 'this is the message template', array(), array(
'some_value' => 42,
), 'some_value', null);
$expected = <<<EOF
Array.some_value:
42 cannot be used here
EOF;
$this
->assertSame($expected, (string) $violation);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConstraintViolationTest:: |
public | function | ||
ConstraintViolationTest:: |
public | function |