/** {@inheritDoc} */ public function isValid($value) { return $this->constraintGroup->matches($value); }
/** * @covers Brickoo\Component\Validation\Constraint\AndOrConstraint::matches * @covers Brickoo\Component\Validation\Constraint\AndOrConstraint::removeFailures */ public function testRemoveFailures() { $andOrConstraint = new AndOrConstraint([$constraint = new IsInternalTypeConstraint("string")]); $this->assertFalse($andOrConstraint->matches(12345)); $this->assertSame($constraint, $andOrConstraint->getFailedConstraint()); $this->assertTrue($andOrConstraint->matches("success")); $this->assertNull($andOrConstraint->getFailedConstraint()); }