ILIAS
Release_5_0_x_branch Revision 61816
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
ilMd5PasswordEncoderTest.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
require_once
'Services/Password/classes/encoders/class.ilMd5PasswordEncoder.php'
;
5
11
class
ilMd5PasswordEncoderTest
extends
PHPUnit_Framework_TestCase
12
{
16
public
function
testInstanceCanBeCreated
()
17
{
18
$this->assertInstanceOf(
'ilMd5PasswordEncoder'
,
new
ilMd5PasswordEncoder
());
19
}
20
24
public
function
testPasswordShouldBeCorrectlyEncoded
()
25
{
26
$encoder =
new
ilMd5PasswordEncoder
();
27
$this->assertSame(md5(
'password'
), $encoder->encodePassword(
'password'
,
''
));
28
}
29
33
public
function
testPasswordCanBeVerified
()
34
{
35
$encoder =
new
ilMd5PasswordEncoder
();
36
$this->assertTrue($encoder->isPasswordValid(md5(
'password'
),
'password'
,
''
));
37
}
38
42
public
function
testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding
()
43
{
44
$encoder =
new
ilMd5PasswordEncoder
();
45
$encoder->encodePassword(str_repeat(
'a'
, 5000),
''
);
46
}
47
51
public
function
testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength
()
52
{
53
$encoder =
new
ilMd5PasswordEncoder
();
54
$this->assertFalse($encoder->isPasswordValid(
'encoded'
, str_repeat(
'a'
, 5000),
''
));
55
}
56
60
public
function
testNameShouldBeMd5
()
61
{
62
$encoder =
new
ilMd5PasswordEncoder
();
63
$this->assertEquals(
'md5'
, $encoder->getName());
64
}
65
}
Services
Password
test
encoders
ilMd5PasswordEncoderTest.php
Generated on Wed Apr 27 2016 21:01:58 for ILIAS by
1.8.1.2 (using
Doxyfile
)