ILIAS  release_8 Revision v8.24
PasswordTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5/* Copyright (c) 2018 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
6
7require_once("libs/composer/vendor/autoload.php");
8
9use ILIAS\Data;
10use PHPUnit\Framework\TestCase;
11
17class PasswordTest extends TestCase
18{
19 protected function setUp(): void
20 {
21 $this->f = new Data\Factory();
22 }
23
24 public function testValue(): void
25 {
26 $pass = 'secret';
27 $pwd = $this->f->password($pass);
28 $this->assertEquals($pass, $pwd->toString());
29 }
30
31 public function testWrongParam(): void
32 {
33 $this->expectException(TypeError::class);
34 $pwd = $this->f->password(123);
35 }
36}
Builds data types.
Definition: Factory.php:21
Tests working with color data object.