mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Add a test.
This commit is contained in:
parent
829a28dc68
commit
55564814b9
21
tests/php/Core/Validation/MemberValidatorTest.php
Normal file
21
tests/php/Core/Validation/MemberValidatorTest.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SilverStripe\Core\Tests\Validation;
|
||||||
|
|
||||||
|
use SilverStripe\Dev\SapphireTest;
|
||||||
|
use SilverStripe\Security\Member;
|
||||||
|
use SilverStripe\Security\Member_Validator;
|
||||||
|
|
||||||
|
class MemberValidatorTest extends SapphireTest
|
||||||
|
{
|
||||||
|
protected $usesDatabase = false;
|
||||||
|
|
||||||
|
public function testMemberValidator(): void
|
||||||
|
{
|
||||||
|
$member = new Member();
|
||||||
|
$compositeValidator = $member->getCMSCompositeValidator();
|
||||||
|
|
||||||
|
$memberValidators = $compositeValidator->getValidatorsByType(Member_Validator::class);
|
||||||
|
$this->assertCount(1, $memberValidators, 'We expect exactly one member validator');
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user