Skip to content

Commit

Permalink
Add a test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfendeksilverstripe committed Sep 27, 2024
1 parent 829a28d commit 5556481
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/php/Core/Validation/MemberValidatorTest.php
Original file line number Diff line number Diff line change
@@ -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');
}
}

0 comments on commit 5556481

Please sign in to comment.