ILIAS
trunk Revision v11.0_alpha-2662-g519ff7d528f
◀ ilDoc Overview
ilCtrlTokenTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
use
PHPUnit\Framework\TestCase
;
22
28
class
ilCtrlTokenTest
extends
TestCase
29
{
30
public
function
testTokenRetrieval
(): void
31
{
32
$expected_value =
'test_token_1'
;
33
$token
=
new
ilCtrlToken
($expected_value);
34
35
$this->assertEquals(
36
$expected_value,
37
$token
->getToken()
38
);
39
}
40
41
public
function
testTokenVerification
(): void
42
{
43
$expected_value =
'test_token_2'
;
44
$token
=
new
ilCtrlToken
($expected_value);
45
$token_value =
$token
->getToken();
46
47
$this->assertTrue(
$token
->verifyWith($token_value));
48
$this->assertFalse(
$token
->verifyWith(
''
));
49
$this->assertFalse(
$token
->verifyWith(
'xyz'
));
50
}
51
}
ilCtrlTokenTest
Class ilCtrlTokenTest.
Definition:
ilCtrlTokenTest.php:28
ilCtrlToken
Class ilCtrlToken is responsible for generating and storing unique CSRF tokens.
Definition:
class.ilCtrlToken.php:27
$token
$token
Definition:
xapitoken.php:70
ilCtrlTokenTest\testTokenRetrieval
testTokenRetrieval()
Definition:
ilCtrlTokenTest.php:30
ilCtrlTokenTest\testTokenVerification
testTokenVerification()
Definition:
ilCtrlTokenTest.php:41
TestCase
TestCase
components
ILIAS
UICore
tests
Token
ilCtrlTokenTest.php
Generated on Wed Sep 3 2025 23:04:24 for ILIAS by
1.8.13 (using
Doxyfile
)