public function testMagicPropertiesAreNotAllowed() { $constraint = new ConstraintA(); $this ->setExpectedException('Symfony\\Component\\Validator\\Exception\\InvalidOptionsException'); $constraint->foo = 'bar'; }