You are here

public function LegacyExecutionContextTest::testClone in Plug 7

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/LegacyExecutionContextTest.php, line 83

Class

LegacyExecutionContextTest
@group legacy

Namespace

Symfony\Component\Validator\Tests

Code

public function testClone() {
  $clone = clone $this->context;

  // Cloning the context keeps the reference to the original violation
  // list. This way we can efficiently duplicate context instances during
  // the validation run and only modify the properties that need to be
  // changed.
  $this
    ->assertSame($this->context
    ->getViolations(), $clone
    ->getViolations());
}