ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PasswordTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21require_once("vendor/composer/vendor/autoload.php");
22
23use ILIAS\Data;
24use PHPUnit\Framework\TestCase;
25
31class PasswordTest extends TestCase
32{
33 protected Data\Factory $f;
34
35 protected function setUp(): void
36 {
37 $this->f = new Data\Factory();
38 }
39
40 public function testValue(): void
41 {
42 $pass = 'secret';
43 $pwd = $this->f->password($pass);
44 $this->assertEquals($pass, $pwd->toString());
45 }
46
47 public function testWrongParam(): void
48 {
49 $this->expectException(TypeError::class);
50 $pwd = $this->f->password(123);
51 }
52}
Tests working with color data object.
Data Factory $f