Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…ValidatorChain` must be cloneable
  • Loading branch information
Ocramius committed Nov 22, 2014
1 parent c15d5d6 commit a19c484
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/ValidatorChainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,26 @@ public function testMergeValidatorChains()
$this->assertCount(2, $this->validator->getValidators());
}

/**
* @group 6386
* @group 6496
*/
public function testValidatorChainIsCloneable()
{
$this->validator->attach(new NotEmpty());

$this->assertCount(1, $this->validator->getValidators());

$clonedValidatorChain = clone $this->validator;

$this->assertCount(1, $clonedValidatorChain->getValidators());

$clonedValidatorChain->attach(new NotEmpty());

$this->assertCount(1, $this->validator->getValidators());
$this->assertCount(2, $clonedValidatorChain->getValidators());
}

public function testCountGivesCountOfAttachedValidators()
{
$this->populateValidatorChain();
Expand Down

0 comments on commit a19c484

Please sign in to comment.