silverstripe-framework/tests/php/Security/MemberTest/VerySpecificPasswordValidator.php
Guy Sartorelli e2e32317d6
API Move various classes to more appropriate namespaces (#11370)
Also rename ViewableData to ModelData ahead of the template layer
lift-and-shift
2024-09-23 14:31:50 +12:00

20 lines
529 B
PHP

<?php
namespace SilverStripe\Security\Tests\MemberTest;
use SilverStripe\Dev\TestOnly;
use SilverStripe\Core\Validation\ValidationResult;
use SilverStripe\Security\PasswordValidator;
class VerySpecificPasswordValidator extends PasswordValidator implements TestOnly
{
public function validate($password, $member)
{
$result = ValidationResult::create();
if (strlen($password ?? '') !== 17) {
$result->addError('Password must be 17 characters long');
}
return $result;
}
}