You are here

public function CollectionTest::testAcceptOptionalConstraintAsOneElementArray in Zircon Profile 8

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

File

vendor/symfony/validator/Tests/Constraints/CollectionTest.php, line 75

Class

CollectionTest
@author Bernhard Schussek <bschussek@gmail.com>

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testAcceptOptionalConstraintAsOneElementArray() {
  $collection1 = new Collection(array(
    'fields' => array(
      'alternate_email' => array(
        new Optional(new Email()),
      ),
    ),
  ));
  $collection2 = new Collection(array(
    'fields' => array(
      'alternate_email' => new Optional(new Email()),
    ),
  ));
  $this
    ->assertEquals($collection1, $collection2);
}