ILIAS
release_9 Revision v9.13-25-g2c18ec4c24f
◀ ilDoc Overview
ilSystemStyleExceptionBaseUnit.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
require_once(
'libs/composer/vendor/autoload.php'
);
22
23
use
PHPUnit\Framework\TestCase
;
24
25
abstract
class
ilSystemStyleExceptionBaseUnit
extends
TestCase
26
{
27
abstract
protected
function
getClassName
(): string;
28
29
public
function
codesProvider
(): array
30
{
31
$reflection =
new
ReflectionClass
($this->
getClassName
());
32
33
$constant_values = array_values($reflection->getConstants());
34
return
array_map(
function
($val) {
35
return
[$val];
36
}, $constant_values);
37
}
38
42
public
function
testConstruct
(
int
$code): void
43
{
44
$class_name = $this->
getClassName
();
45
$this->assertInstanceOf($class_name,
new
$class_name($code,
'Additional Info'
));
46
}
47
51
public
function
testAssignMessageToCode
(
int
$code): void
52
{
53
$class_name = $this->
getClassName
();
54
$exception =
new
$class_name($code,
'Additional Info'
);
55
$this->assertIsString($exception->getMessage());
56
}
57
61
public
function
testToString
(
int
$code): void
62
{
63
$class_name = $this->
getClassName
();
64
$exception =
new
$class_name($code,
'Additional Info'
);
65
$this->assertIsString($exception->__toString());
66
}
67
}
ilSystemStyleExceptionBaseUnit\codesProvider
codesProvider()
Definition:
ilSystemStyleExceptionBaseUnit.php:29
ilSystemStyleExceptionBaseUnit\testConstruct
testConstruct(int $code)
codesProvider
Definition:
ilSystemStyleExceptionBaseUnit.php:42
ilSystemStyleExceptionBaseUnit\getClassName
getClassName()
ilSystemStyleExceptionBaseUnit
Definition:
ilSystemStyleExceptionBaseUnit.php:25
ilSystemStyleExceptionBaseUnit\testAssignMessageToCode
testAssignMessageToCode(int $code)
codesProvider
Definition:
ilSystemStyleExceptionBaseUnit.php:51
ilSystemStyleExceptionBaseUnit\testToString
testToString(int $code)
codesProvider
Definition:
ilSystemStyleExceptionBaseUnit.php:61
ReflectionClass
TestCase
Services
Style
System
test
Exceptions
ilSystemStyleExceptionBaseUnit.php
Generated on Wed Sep 10 2025 14:11:57 for ILIAS by
1.8.13 (using
Doxyfile
)