Definition at line 32 of file DListTest.php.
◆ obviousNoMatchProvider()
static ILIAS\Data\Description\DListTest::obviousNoMatchProvider |
( |
| ) |
|
|
static |
Definition at line 59 of file DListTest.php.
59 : array
60 {
61 return [
62 [1], ["1"], [null], [true], [new \StdClass()], [new \DateTimeImmutable()]
63 ];
64 }
◆ setUp()
ILIAS\Data\Description\DListTest::setUp |
( |
| ) |
|
Definition at line 37 of file DListTest.php.
37 : void
38 {
39 $this->v = $this->createMock(Description::class);
40 $this->l = new DList(
41 $this->createMock(\
ILIAS\Data\Text\SimpleDocumentMarkdown::class),
42 $this->v
43 );
44 }
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
◆ testEmptyMatches()
ILIAS\Data\Description\DListTest::testEmptyMatches |
( |
| ) |
|
Definition at line 66 of file DListTest.php.
66 : void
67 {
68 $res = $this->l->getPrimitiveRepresentation([]);
69
70 $this->assertEquals([],
$res);
71 }
References $res.
◆ testFailsOnValueFailure()
ILIAS\Data\Description\DListTest::testFailsOnValueFailure |
( |
| ) |
|
Definition at line 93 of file DListTest.php.
93 : void
94 {
96
97 $this->v
98 ->method("getPrimitiveRepresentation")
99 ->willReturn(fn() => yield "FAILURE");
100
101 $res = $this->l->getPrimitiveRepresentation(
$data);
102
103 $this->assertInstanceOf(\Closure::class,
$res);
104 $errors = iterator_to_array(
$res());
105 $this->assertCount(1, $errors);
106 $this->assertTrue(is_string($errors[0]));
107 $this->assertTrue(str_contains($errors[0], "FAILURE"));
108 }
References $data, and $res.
◆ testForwardsToSubDescription()
ILIAS\Data\Description\DListTest::testForwardsToSubDescription |
( |
| ) |
|
Definition at line 73 of file DListTest.php.
73 : void
74 {
76
77 $values = ["c", "d"];
78 $this->v->expects($this->exactly(2))
79 ->method("getPrimitiveRepresentation")
80 ->willReturnCallback(
function (
$v) use (&$values) {
81 array_push($values,
$v);
82 return array_shift($values);
83 });
84
85 $expected = ["c", "d"];
86
87 $res = $this->l->getPrimitiveRepresentation(
$data);
88
89 $this->assertEquals($expected,
$res);
90 $this->assertEquals(["a", "b"], $values);
91 }
References $data, $res, and ILIAS\Data\Description\DListTest\$v.
◆ testObviouslyNotMatching()
ILIAS\Data\Description\DListTest::testObviouslyNotMatching |
( |
|
$data | ) |
|
@dataProvider obviousNoMatchProvider
Definition at line 49 of file DListTest.php.
49 : void
50 {
51 $res = $this->l->getPrimitiveRepresentation(
$data);
52
53 $this->assertInstanceOf(\Closure::class,
$res);
54 $errors = iterator_to_array(
$res());
55 $this->assertCount(1, $errors);
56 $this->assertTrue(is_string($errors[0]));
57 }
References $data, and $res.
◆ testRenumbersEntrys()
ILIAS\Data\Description\DListTest::testRenumbersEntrys |
( |
| ) |
|
Definition at line 110 of file DListTest.php.
110 : void
111 {
112 $data = [2 =>
"a", 27 =>
"b"];
113
114 $this->v
115 ->method("getPrimitiveRepresentation")
116 ->will($this->returnCallback(fn(
$v) =>
$v));
117
118 $res = $this->l->getPrimitiveRepresentation(
$data);
119
120 $expected = ["a", "b"];
121
122 $this->assertEquals($expected,
$res);
124 }
References $data, $res, and ILIAS\Data\Description\DListTest\$v.
◆ $l
DList ILIAS\Data\Description\DListTest::$l |
|
protected |
◆ $v
The documentation for this class was generated from the following file: