ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilIndividualAssessmentDataSetTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use PHPUnit\Framework\TestCase;
22
24{
25 public function __construct()
26 {
27 }
28
29 public function getTypesWrapper(string $entity, string $version): array
30 {
31 return $this->getTypes($entity, $version);
32 }
33
34 public function getXmlNamespaceWrapper(string $a_entity, string $a_schema_version): string
35 {
36 return $this->getXmlNamespace($a_entity, $a_schema_version);
37 }
38}
39
41{
42 public function test_crateObject(): void
43 {
45 $this->assertInstanceOf(ilIndividualAssessmentDataSet::class, $obj);
46 }
47
48 public function test_getSupportedVersions(): void
49 {
50 $expected = ['5.2.0', '5.3.0', '9.0.0'];
51
53 $result = $obj->getSupportedVersions();
54
55 $this->assertIsArray($result);
56 $this->assertEquals($expected, $result);
57 }
58
59 public function test_getXmlNamespaceWrapper(): void
60 {
61 $expected = 'http://www.ilias.de/xml/Modules/IndividualAssessment/entity_string';
62
64 $result = $obj->getXmlNamespaceWrapper("entity_string", "not_implemented");
65
66 $this->assertEquals($expected, $result);
67 }
68
69 public function test_getTypes_default(): void
70 {
72 $result = $obj->getTypesWrapper("no_entity", "");
73
74 $this->assertIsArray($result);
75 $this->assertEmpty($result);
76 }
77
78 public function test_getTypes_iass(): void
79 {
80 $expected = [
81 "id" => "integer",
82 "title" => "text",
83 "description" => "text",
84 "content" => "text",
85 "recordTemplate" => "text",
86 "eventTimePlaceRequired" => "integer",
87 "file_required" => "integer",
88 "contact" => "text",
89 "responsibility" => "text",
90 "phone" => "text",
91 "mails" => "text",
92 "consultation_hours" => "text"
93 ];
94
96 $result = $obj->getTypesWrapper("iass", "");
97
98 $this->assertIsArray($result);
99 $this->assertEquals($expected, $result);
100 }
101}
string $version
string $entity
getXmlNamespaceWrapper(string $a_entity, string $a_schema_version)
Individual Assessment dataset class.
getTypes(string $a_entity, string $a_version)
Map XML attributes of entities to data types (text, integer...)
getXmlNamespace(string $a_entity, string $a_schema_version)