ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
4 require_once("libs/composer/vendor/autoload.php");
5 
6 use ILIAS\Data;
7 
14 {
15  protected function setUp()
16  {
17  $this->f = new Data\Factory();
18  }
19 
20  public function testValue()
21  {
22  $pass = 'secret';
23  $pwd = $this->f->password($pass);
24  $this->assertEquals($pass, $pwd->toString());
25  }
26 
27  public function testWrongParam()
28  {
29  try {
30  $pwd = $this->f->password(123);
31  $this->assertFalse("This should not happen");
32  } catch (\InvalidArgumentException $e) {
33  $this->assertTrue(true);
34  }
35  }
36 }
Tests working with color data object.