class CollectionTest

Same name in this branch

@author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

  • class \Symfony\Component\Validator\Tests\Constraints\CollectionTest extends \Symfony\Component\Validator\Tests\Constraints\PHPUnit_Framework_TestCase

Expanded class hierarchy of CollectionTest

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CollectionTest.php, line 22

Namespace

Symfony\Component\Validator\Tests\Constraints
View source
class CollectionTest extends \PHPUnit_Framework_TestCase {

  /**
   * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
   */
  public function testRejectInvalidFieldsOption() {
    new Collection(array(
      'fields' => 'foo',
    ));
  }

  /**
   * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
   */
  public function testRejectNonConstraints() {
    new Collection(array(
      'foo' => 'bar',
    ));
  }

  /**
   * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
   */
  public function testRejectValidConstraint() {
    new Collection(array(
      'foo' => new Valid(),
    ));
  }

  /**
   * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
   */
  public function testRejectValidConstraintWithinOptional() {
    new Collection(array(
      'foo' => new Optional(new Valid()),
    ));
  }

  /**
   * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
   */
  public function testRejectValidConstraintWithinRequired() {
    new Collection(array(
      'foo' => new Required(new Valid()),
    ));
  }

}

Members