You are here

public function CollectionValidatorTest::testObjectShouldBeLeftUnchanged in Plug 7

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php, line 369

Class

CollectionValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testObjectShouldBeLeftUnchanged() {
  $value = new \ArrayObject(array(
    'foo' => 3,
  ));
  $constraint = new Range(array(
    'min' => 2,
  ));
  $this
    ->expectValidateValueAt(0, '[foo]', $value['foo'], array(
    $constraint,
  ));
  $this->validator
    ->validate($value, new Collection(array(
    'fields' => array(
      'foo' => $constraint,
    ),
  )));
  $this
    ->assertEquals(array(
    'foo' => 3,
  ), (array) $value);
}