ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
ILIAS\Data\Description\DDValueTest Class Reference
+ Inheritance diagram for ILIAS\Data\Description\DDValueTest:
+ Collaboration diagram for ILIAS\Data\Description\DDValueTest:

Public Member Functions

 testIntRepresentation (ValueType $type, $value, $is_match)
 

Static Public Member Functions

static casesProvider ()
 

Detailed Description

Definition at line 32 of file DValueTest.php.

Member Function Documentation

◆ casesProvider()

static ILIAS\Data\Description\DDValueTest::casesProvider ( )
static

Definition at line 54 of file DValueTest.php.

54 : array
55 {
56 return [
57 [ValueType::INT, 42, true],
58 [ValueType::INT, "foo", false],
59 [ValueType::FLOAT, 2.3, true],
60 [ValueType::FLOAT, "foo", false],
61 [ValueType::STRING, "foo", true],
62 [ValueType::STRING, 2, false],
63 [ValueType::DATETIME, new \DateTimeImmutable(), true],
64 [ValueType::DATETIME, "foo", false],
65 [ValueType::BOOL, true, true],
66 [ValueType::BOOL, false, true],
67 [ValueType::BOOL, "true", false],
68 [ValueType::BOOL, 1, false],
69 [ValueType::BOOL, null, false],
70 [ValueType::NULL, null, true],
71 [ValueType::NULL, false, false],
72 ];
73 }

References ILIAS\Data\Description\NULL.

◆ testIntRepresentation()

ILIAS\Data\Description\DDValueTest::testIntRepresentation ( ValueType  $type,
  $value,
  $is_match 
)

Definition at line 35 of file DValueTest.php.

35 : void
36 {
37 $desc = new DValue(
38 $this->createMock(\ILIAS\Data\Text\SimpleDocumentMarkdown::class),
39 $type
40 );
41
42 $res = $desc->getPrimitiveRepresentation($value);
43
44 if ($is_match) {
45 $this->assertEquals($value, $res);
46 } else {
47 $this->assertInstanceOf(\Closure::class, $res);
48 $errors = iterator_to_array($res());
49 $this->assertCount(1, $errors);
50 $this->assertTrue(is_string($errors[0]));
51 }
52 }
$res
Definition: ltiservices.php:69
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

References $res.


The documentation for this class was generated from the following file: