Definition at line 32 of file DMapTest.php.
◆ obviousNoMatchProvider()
static ILIAS\Data\DMapTest::obviousNoMatchProvider |
( |
| ) |
|
|
static |
Definition at line 62 of file DMapTest.php.
References null.
65 [1], [
"1"], [
null], [
true], [new \StdClass()], [new \DateTimeImmutable()]
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ setUp()
ILIAS\Data\DMapTest::setUp |
( |
| ) |
|
Definition at line 38 of file DMapTest.php.
40 $this->k = $this->createMock(DValue::class);
41 $this->v = $this->createMock(Description::class);
43 $this->createMock(\
ILIAS\
Data\Text\SimpleDocumentMarkdown::class),
Interface Observer Contains several chained tasks and infos about them.
◆ testEmptyMatches()
ILIAS\Data\DMapTest::testEmptyMatches |
( |
| ) |
|
Definition at line 69 of file DMapTest.php.
References $res.
71 $res = $this->m->getPrimitiveRepresentation([]);
73 $this->assertEquals([],
$res);
◆ testFailsOnKeyFailure()
ILIAS\Data\DMapTest::testFailsOnKeyFailure |
( |
| ) |
|
Definition at line 111 of file DMapTest.php.
References $data, and $res.
116 ->method(
"getPrimitiveRepresentation")
120 ->method(
"getPrimitiveRepresentation")
121 ->willReturn(fn() => yield
"FAILURE");
123 $res = $this->m->getPrimitiveRepresentation(
$data);
125 $this->assertInstanceOf(\Closure::class,
$res);
126 $errors = iterator_to_array(
$res());
127 $this->assertCount(1, $errors);
128 $this->assertTrue(is_string($errors[0]));
129 $this->assertTrue(str_contains($errors[0],
"FAILURE"));
◆ testFailsOnValueFailure()
ILIAS\Data\DMapTest::testFailsOnValueFailure |
( |
| ) |
|
Definition at line 132 of file DMapTest.php.
References $data, and $res.
137 ->method(
"getPrimitiveRepresentation")
138 ->willReturn(fn() => yield
"FAILURE");
141 ->method(
"getPrimitiveRepresentation")
144 $res = $this->m->getPrimitiveRepresentation(
$data);
146 $this->assertInstanceOf(\Closure::class,
$res);
147 $errors = iterator_to_array(
$res());
148 $this->assertCount(1, $errors);
149 $this->assertTrue(is_string($errors[0]));
150 $this->assertTrue(str_contains($errors[0],
"FAILURE"));
◆ testForwardsToSubDescriptions()
ILIAS\Data\DMapTest::testForwardsToSubDescriptions |
( |
| ) |
|
Definition at line 76 of file DMapTest.php.
References $data, and $res.
84 $this->k->expects($this->exactly(2))
85 ->method(
"getPrimitiveRepresentation")
86 ->willReturnCallback(
function (
$v) use (&$keys) {
87 array_push($keys,
$v);
88 return array_shift($keys);
92 $this->v->expects($this->exactly(2))
93 ->method(
"getPrimitiveRepresentation")
94 ->willReturnCallback(
function (
$v) use (&$values) {
95 array_push($values,
$v);
96 return array_shift($values);
104 $res = $this->m->getPrimitiveRepresentation(
$data);
106 $this->assertEquals($expected,
$res);
107 $this->assertEquals([
"a",
"b"], $keys);
108 $this->assertEquals([1, 2], $values);
◆ testObviouslyNotMatching()
ILIAS\Data\DMapTest::testObviouslyNotMatching |
( |
|
$data | ) |
|
obviousNoMatchProvider
Definition at line 52 of file DMapTest.php.
References $data, and $res.
54 $res = $this->m->getPrimitiveRepresentation(
$data);
56 $this->assertInstanceOf(\Closure::class,
$res);
57 $errors = iterator_to_array(
$res());
58 $this->assertCount(1, $errors);
59 $this->assertTrue(is_string($errors[0]));
◆ $k
DValue ILIAS\Data\DMapTest::$k |
|
protected |
◆ $m
DMap ILIAS\Data\DMapTest::$m |
|
protected |
◆ $v
The documentation for this class was generated from the following file: