ILIAS  release_7 Revision v7.30-3-g800a261c036
ilGroupNameAsMailValidatorTest.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2
3/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
4
11{
15 public function testGroupIsDetectedIfGroupNameExists() : void
16 {
17 $validator = new ilGroupNameAsMailValidator('someHost', function (string $groupName) {
18 return true;
19 });
20
21 $this->assertTrue($validator->validate(new ilMailAddress('phpunit', 'someHost')));
22 }
23
28 {
29 $validator = new ilGroupNameAsMailValidator('someHost', function (string $groupName) {
30 return false;
31 });
32
33 $this->assertFalse($validator->validate(new ilMailAddress('someHost', 'someHost')));
34 }
35}
An exception for terminatinating execution or to throw for unit testing.
Class ilGroupNameAsMailValidatorTest.
Class ilGroupNameAsMailValidator.
Class ilMailAddress.
Class ilMailBaseTest.