ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ 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\LazyProvide
;
26
use
ILIAS\LegalDocuments\UseSlot
;
27
use
ILIAS\LegalDocuments\Consumer
;
28
use
PHPUnit\Framework\TestCase
;
29
use
ILIAS\LegalDocuments\Internal
;
30
31
require_once __DIR__ .
'/ContainerMock.php'
;
32
33
class
InternalTest
extends
TestCase
34
{
35
use
ContainerMock
;
36
37
public
function
testConstruct
(): void
38
{
39
$this->assertInstanceOf(Internal::class,
new
Internal
($this->fail(...), $this->fail(...), []));
40
}
41
42
public
function
testAll
(): void
43
{
44
$this->assertSame([
'a'
=> 1,
'b'
=> 2,
'c'
=> 3], $this->
createWithDummy
()->all(
'foo'
));
45
}
46
47
public
function
testGet
(): void
48
{
49
$this->assertSame(2, $this->
createWithDummy
()->
get
(
'foo'
,
'b'
));
50
}
51
52
private
function
createWithDummy
():
Internal
53
{
54
return
new
Internal
(
55
$this->fail(...),
56
fn() => $this->
wiring
(),
57
[
58
$this->
dummyConsumer
()::
class
59
]
60
);
61
}
62
63
private
function
dummyConsumer
():
Consumer
64
{
65
return
new
class
() implements
Consumer
{
66
public
function
uses(
UseSlot
$slot,
LazyProvide
$provide):
UseSlot
67
{
68
return
$slot;
69
}
70
public
function
id
():
string
71
{
72
return
self::class;
73
}
74
};
75
}
76
77
private
function
wiring
():
Wiring
78
{
79
return
new
class
() extends
Wiring
{
80
public
function
__construct
()
81
{
82
}
83
public
function
map():
Map
84
{
85
return
new
Map
([
'foo'
=> [
'a'
=> 1,
'b'
=> 2,
'c'
=> 3]]);
86
}
87
};
88
}
89
}
ContainerMock
ILIAS\LegalDocuments\test\InternalTest\testGet
testGet()
Definition:
InternalTest.php:47
ILIAS\LegalDocuments\test\InternalTest\testConstruct
testConstruct()
Definition:
InternalTest.php:37
ILIAS\LegalDocuments\Consumer
Definition:
Consumer.php:23
UseSlot
ILIAS\LegalDocuments\Internal
Definition:
Internal.php:26
Internal
ILIAS\LegalDocuments\LazyProvide
Definition:
LazyProvide.php:30
ILIAS\LegalDocuments\Map
Definition:
Map.php:26
ILIAS\LegalDocuments\Wiring
Definition:
Wiring.php:44
ILIAS\LegalDocuments\UseSlot
Definition:
UseSlot.php:35
ILIAS\LegalDocuments\test\InternalTest\dummyConsumer
dummyConsumer()
Definition:
InternalTest.php:63
ILIAS\LegalDocuments\test\InternalTest
Definition:
InternalTest.php:33
ILIAS\__construct
__construct()
Constructor setup ILIAS global object public.
Definition:
class.ilias.php:76
Map
ILIAS\LegalDocuments\test\InternalTest\testAll
testAll()
Definition:
InternalTest.php:42
ILIAS\LegalDocuments\test\InternalTest\wiring
wiring()
Definition:
InternalTest.php:77
ILIAS\LegalDocuments\test
Definition:
AdministrationEditLinksTest.php:21
Wiring
ILIAS\GlobalScreen\Provider\id
id()
Definition:
PluginProviderHelper.php:54
LazyProvide
ILIAS\LegalDocuments\Consumer
TestCase
ILIAS\LegalDocuments\test\InternalTest\createWithDummy
createWithDummy()
Definition:
InternalTest.php:52
components
ILIAS
LegalDocuments
tests
InternalTest.php
Generated on Sun Aug 31 2025 23:03:16 for ILIAS by
1.8.13 (using
Doxyfile
)