ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
PasswordTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /* Copyright (c) 2018 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
6 
7 require_once("libs/composer/vendor/autoload.php");
8 
9 use ILIAS\Data;
11 
17 class 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 }
Tests working with color data object.