public function ExecutionContextTest::testClone

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/ExecutionContextTest.php, line 73

Class

ExecutionContextTest

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());
}