use Symfony\Component\Validator\Constraints\NotCompromisedPassword;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Mapping\Loader\AttributeLoader;
/**
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class NotCompromisedPasswordTest extends TestCase
{ public function testDefaultValues() { $constraint =
new NotCompromisedPassword();
$this->
assertSame(1,
$constraint->threshold
);
$this->
assertFalse($constraint->skipOnError
);
} public function testAttributes() { $metadata =
new ClassMetadata(NotCompromisedPasswordDummy::
class);
$loader =
new AttributeLoader();
self::
assertTrue($loader->
loadClassMetadata($metadata));
[$aConstraint] =
$metadata->properties
['a'
]->
getConstraints();