You are here

public function ConstraintTest::testSerializeKeepsCustomGroups in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/ConstraintTest.php \Symfony\Component\Validator\Tests\ConstraintTest::testSerializeKeepsCustomGroups()

File

vendor/symfony/validator/Tests/ConstraintTest.php, line 189

Class

ConstraintTest

Namespace

Symfony\Component\Validator\Tests

Code

public function testSerializeKeepsCustomGroups() {
  $constraint = new ConstraintA(array(
    'property1' => 'foo',
    'property2' => 'bar',
    'groups' => 'MyGroup',
  ));
  $constraint = unserialize(serialize($constraint));
  $this
    ->assertSame(array(
    'MyGroup',
  ), $constraint->groups);
}