ILIAS
trunk Revision v11.0_alpha-1713-gd8962da2f67
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
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
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
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
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
OnlineStatusFilterTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots
;
22
23
use
ILIAS\LegalDocuments\test\ContainerMock
;
24
use
ilRbacReview
;
25
use
PHPUnit\Framework\TestCase
;
26
27
require_once __DIR__ .
'/../../ContainerMock.php'
;
28
29
class
OnlineStatusFilterTest
extends
TestCase
30
{
31
use
ContainerMock
;
32
33
public
function
testConstruct
(): void
34
{
35
$this->assertInstanceOf(OnlineStatusFilter::class,
new
OnlineStatusFilter
(
36
$this->fail(...),
37
$this->mock(ilRbacReview::class)
38
));
39
}
40
41
public
function
testInvoke
(): void
42
{
43
if
(!defined(
'SYSTEM_ROLE_ID'
)) {
44
define(
'SYSTEM_ROLE_ID'
, 14);
45
}
46
if
(!defined(
'SYSTEM_USER_ID'
)) {
47
define(
'SYSTEM_USER_ID'
, 9);
48
}
49
50
$rbac = $this->mock(ilRbacReview::class);
51
$rbac->method(
'isAssigned'
)->willReturnCallback(
function
(
int
$user,
int
$role) {
52
$this->assertSame(
SYSTEM_ROLE_ID
, $role);
53
return
$user === 7;
54
});
55
56
$instance =
new
OnlineStatusFilter
(
57
fn($ids) => array_intersect($ids, [3, 4, 7]),
58
$rbac
59
);
60
61
$this->assertSame([1, 2, 5, 6, 7, 8], $instance([1, 2, 3, 4, 5, 6, 7, 8]));
62
}
63
}
ContainerMock
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\OnlineStatusFilterTest\testConstruct
testConstruct()
Definition:
OnlineStatusFilterTest.php:33
SYSTEM_ROLE_ID
const SYSTEM_ROLE_ID
Definition:
constants.php:29
ilRbacReview
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\OnlineStatusFilterTest\testInvoke
testInvoke()
Definition:
OnlineStatusFilterTest.php:41
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\OnlineStatusFilter
Definition:
OnlineStatusFilter.php:26
ContainerMock
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\OnlineStatusFilterTest
Definition:
OnlineStatusFilterTest.php:29
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots
Definition:
Agreement.php:21
TestCase
components
ILIAS
LegalDocuments
tests
ConsumerToolbox
ConsumerSlots
OnlineStatusFilterTest.php
Generated on Fri Apr 4 2025 23:03:27 for ILIAS by
1.8.13 (using
Doxyfile
)