You are here

public function ConstraintTest::testSerializeInitializesGroupsOptionToDefault in Plug 7

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/ConstraintTest.php, line 171

Class

ConstraintTest

Namespace

Symfony\Component\Validator\Tests

Code

public function testSerializeInitializesGroupsOptionToDefault() {
  $constraint = new ConstraintA(array(
    'property1' => 'foo',
    'property2' => 'bar',
  ));
  $constraint = unserialize(serialize($constraint));
  $expected = new ConstraintA(array(
    'property1' => 'foo',
    'property2' => 'bar',
    'groups' => 'Default',
  ));
  $this
    ->assertEquals($expected, $constraint);
}