ILIAS
release_9 Revision v9.13-25-g2c18ec4c24f
◀ ilDoc Overview
InternalTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\LegalDocuments\test
;
22
23
use
ILIAS\LegalDocuments\Map
;
24
use
ILIAS\LegalDocuments\Wiring
;
25
use
ILIAS\LegalDocuments\test\ContainerMock
;
26
use
ILIAS\LegalDocuments\LazyProvide
;
27
use
ILIAS\LegalDocuments\UseSlot
;
28
use
ILIAS\LegalDocuments\Consumer
;
29
use
PHPUnit\Framework\TestCase
;
30
use
ILIAS\LegalDocuments\Internal
;
31
32
require_once __DIR__ .
'/ContainerMock.php'
;
33
34
class
InternalTest
extends
TestCase
35
{
36
use
ContainerMock
;
37
38
public
function
testConstruct
(): void
39
{
40
$this->assertInstanceOf(Internal::class,
new
Internal
($this->fail(...), $this->fail(...), []));
41
}
42
43
public
function
testAll
(): void
44
{
45
$this->assertSame([
'a'
=> 1,
'b'
=> 2,
'c'
=> 3], $this->
createWithDummy
()->all(
'foo'
));
46
}
47
48
public
function
testGet
(): void
49
{
50
$this->assertSame(2, $this->
createWithDummy
()->
get
(
'foo'
,
'b'
));
51
}
52
53
private
function
createWithDummy
():
Internal
54
{
55
return
new
Internal
(
56
$this->fail(...),
57
fn() => $this->
wiring
(),
58
[
59
get_class($this->
dummyConsumer
())
60
]
61
);
62
}
63
64
private
function
dummyConsumer
():
Consumer
65
{
66
return
new
class
() implements
Consumer
{
67
public
function
uses(
UseSlot
$slot,
LazyProvide
$provide):
UseSlot
68
{
69
return
$slot;
70
}
71
public
function
id
():
string
72
{
73
return
self::class;
74
}
75
};
76
}
77
78
private
function
wiring
():
Wiring
79
{
80
return
new
class
() extends
Wiring
{
81
public
function
__construct
()
82
{
83
}
84
public
function
map():
Map
85
{
86
return
new
Map
([
'foo'
=> [
'a'
=> 1,
'b'
=> 2,
'c'
=> 3]]);
87
}
88
};
89
}
90
}
ContainerMock
ILIAS\LegalDocuments\test\InternalTest\testGet
testGet()
Definition:
InternalTest.php:48
ILIAS\LegalDocuments\test\InternalTest\testConstruct
testConstruct()
Definition:
InternalTest.php:38
ILIAS\LegalDocuments\Consumer
Definition:
Consumer.php:23
UseSlot
ILIAS\LegalDocuments\Internal
Definition:
Internal.php:25
Internal
ILIAS\LegalDocuments\LazyProvide
Definition:
LazyProvide.php:30
ILIAS\LegalDocuments\Map
Definition:
Map.php:26
ILIAS\LegalDocuments\Wiring
Definition:
Wiring.php:48
ILIAS\LegalDocuments\UseSlot
Definition:
UseSlot.php:33
ILIAS\LegalDocuments\test\InternalTest\dummyConsumer
dummyConsumer()
Definition:
InternalTest.php:64
ILIAS\LegalDocuments\test\InternalTest
Definition:
InternalTest.php:34
ILIAS\__construct
__construct()
Constructor setup ILIAS global object public.
Definition:
class.ilias.php:62
ContainerMock
Map
ILIAS\LegalDocuments\test\InternalTest\testAll
testAll()
Definition:
InternalTest.php:43
ILIAS\LegalDocuments\test\InternalTest\wiring
wiring()
Definition:
InternalTest.php:78
ILIAS\LegalDocuments\test
Definition:
AdministrationEditLinksTest.php:21
Wiring
ILIAS\GlobalScreen\Provider\id
id()
Definition:
PluginProviderHelper.php:54
LazyProvide
Consumer
TestCase
ILIAS\LegalDocuments\test\InternalTest\createWithDummy
createWithDummy()
Definition:
InternalTest.php:53
Services
LegalDocuments
test
InternalTest.php
Generated on Wed Sep 10 2025 14:11:33 for ILIAS by
1.8.13 (using
Doxyfile
)