public function ExecutionContextTest::testAddViolationAtUsesPreconfiguredValueIfNotPassed

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/ExecutionContextTest.php, line 184

Class

ExecutionContextTest

Namespace

Symfony\Component\Validator\Tests

Code

public function testAddViolationAtUsesPreconfiguredValueIfNotPassed() {
  $this->translator
    ->expects($this
    ->once())
    ->method('trans')
    ->with('Error', array())
    ->will($this
    ->returnValue('Translated error'));
  $this->context
    ->addViolationAt('bam.baz', 'Error');
  $this
    ->assertEquals(new ConstraintViolationList(array(
    new ConstraintViolation('Translated error', 'Error', array(), 'Root', 'foo.bar.bam.baz', 'currentValue'),
  )), $this->context
    ->getViolations());
}