ILIAS
release_8 Revision v8.19
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
j
l
m
p
s
t
u
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
v
x
+
Variables
$
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
IncidentTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Modules\Test\test
;
22
23
use
PHPUnit\Framework\TestCase
;
24
use
ILIAS\Modules\Test\Incident
;
25
26
class
IncidentTest
extends
TestCase
27
{
28
public
function
testConstruct
(): void
29
{
30
$this->assertInstanceOf(Incident::class,
new
Incident
());
31
}
32
33
public
function
testAny
(): void
34
{
35
$incident =
new
Incident
();
36
$this->assertTrue($incident->any(
static
fn (
int
$x) => $x === 2, [1, 2, 3]));
37
}
38
39
public
function
testAnyBreaksAtFirstTrue
(): void
40
{
41
$incident =
new
Incident
();
42
$throw_error =
false
;
43
44
$this->assertTrue($incident->any(
static
function
(
int
$x) use (&$throw_error):
bool
{
45
if
($throw_error) {
46
throw
new
Exception
(
'Should not be called anymore.'
);
47
} elseif ($x === 2) {
48
$throw_error =
true
;
49
return
true
;
50
}
51
return
false
;
52
}, [1, 2, 3]));
53
}
54
55
public
function
testAnyReturnsFalse
(): void
56
{
57
$incident =
new
Incident
();
58
$this->assertFalse($incident->any(
static
fn (
int
$x) =>
false
, [1, 2, 3]));
59
}
60
}
ILIAS\Modules\Test\Incident
Definition:
Incident.php:23
ILIAS\Modules\Test\test
Definition:
AccessFileUploadAnswerTest.php:21
ILIAS\Modules\Test\test\IncidentTest\testAny
testAny()
Definition:
IncidentTest.php:33
ILIAS\Modules\Test\test\IncidentTest
Definition:
IncidentTest.php:26
Incident
function
ILIAS\Modules\Test\test\IncidentTest\testAnyBreaksAtFirstTrue
testAnyBreaksAtFirstTrue()
Definition:
IncidentTest.php:39
ILIAS\Modules\Test\test\IncidentTest\testAnyReturnsFalse
testAnyReturnsFalse()
Definition:
IncidentTest.php:55
TestCase
ILIAS\Modules\Test\test\IncidentTest\testConstruct
testConstruct()
Definition:
IncidentTest.php:28
Exception
Modules
Test
test
IncidentTest.php
Generated on Tue Apr 1 2025 22:01:40 for ILIAS by
1.8.13 (using
Doxyfile
)