ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
GroupTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ILIAS\Data\Factory as DataFactory;
29use ILIAS\Refinery\Password\Group as PasswordGroup;
30use PHPUnit\Framework\TestCase;
32use PHPUnit\Framework\MockObject\Stub;
33
34class GroupTest extends TestCase
35{
36 private PasswordGroup $group;
37 private DataFactory $dataFactory;
38 private Language&Stub $language;
39
40 protected function setUp(): void
41 {
42 $this->dataFactory = new DataFactory();
43 $this->language = $this->createStub(Language::class);
44
45 $this->group = new PasswordGroup($this->dataFactory, $this->language);
46 }
47
48 public function testHasMinLength(): void
49 {
50 $instance = $this->group->hasMinLength(4);
51 $this->assertInstanceOf(HasMinLength::class, $instance);
52 }
53
54 public function testHasLowerChars(): void
55 {
56 $instance = $this->group->hasLowerChars();
57 $this->assertInstanceOf(HasLowerChars::class, $instance);
58 }
59
60 public function testHasNumbers(): void
61 {
62 $instance = $this->group->hasNumbers();
63 $this->assertInstanceOf(HasNumbers::class, $instance);
64 }
65
66 public function testHasSpecialChars(): void
67 {
68 $instance = $this->group->hasSpecialChars();
69 $this->assertInstanceOf(HasSpecialChars::class, $instance);
70 }
71
72 public function testHasUpperChars(): void
73 {
74 $instance = $this->group->hasUpperChars();
75 $this->assertInstanceOf(HasUpperChars::class, $instance);
76 }
77}
Builds data types.
Definition: Factory.php:36