use Symfony\Component\Validator\Tests\Constraints\Fixtures\WhenTestWithAttributes;
final class WhenTest extends TestCase
{ use ExpectDeprecationTrait;
public function testMissingOptionsExceptionIsThrown() { $this->
expectException(MissingOptionsException::
class);
$this->
expectExceptionMessage('The options "expression", "constraints" must be set for constraint "Symfony\Component\Validator\Constraints\When".'
);
new When([]);
} public function testNonConstraintsAreRejected() { $this->
expectException(ConstraintDefinitionException::
class);
$this->
expectExceptionMessage('The value "foo" is not an instance of Constraint in constraint "Symfony\Component\Validator\Constraints\When"'
);
new When('true',
[ 'foo',
]);
}