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