You are here

public function LegacyElementMetadataTest::testSerialize in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/validator/Tests/Mapping/LegacyElementMetadataTest.php \Symfony\Component\Validator\Tests\Mapping\LegacyElementMetadataTest::testSerialize()

File

vendor/symfony/validator/Tests/Mapping/LegacyElementMetadataTest.php, line 65

Class

LegacyElementMetadataTest
@group legacy

Namespace

Symfony\Component\Validator\Tests\Mapping

Code

public function testSerialize() {
  $this->metadata
    ->addConstraint(new ConstraintA(array(
    'property1' => 'A',
  )));
  $this->metadata
    ->addConstraint(new ConstraintB(array(
    'groups' => 'TestGroup',
  )));
  $metadata = unserialize(serialize($this->metadata));
  $this
    ->assertEquals($this->metadata, $metadata);
}