ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
PasswordTest.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2018 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
4require_once("libs/composer/vendor/autoload.php");
5
6use ILIAS\Data;
7use PHPUnit\Framework\TestCase;
8
14class PasswordTest extends TestCase
15{
16 protected function setUp() : void
17 {
18 $this->f = new Data\Factory();
19 }
20
21 public function testValue()
22 {
23 $pass = 'secret';
24 $pwd = $this->f->password($pass);
25 $this->assertEquals($pass, $pwd->toString());
26 }
27
28 public function testWrongParam()
29 {
30 try {
31 $pwd = $this->f->password(123);
32 $this->assertFalse("This should not happen");
33 } catch (\InvalidArgumentException $e) {
34 $this->assertTrue(true);
35 }
36 }
37}
An exception for terminatinating execution or to throw for unit testing.
Builds data types.
Definition: Factory.php:20
Tests working with color data object.