ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLearningSequenceSettingsTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
25  public const TO_OBJ_ID = 10;
26  public const TO_ABSTRACT = "abstract";
27  public const TO_EXTRO = "extro";
28  public const TO_ABSTRACT_IMAGE = "abstract/image/path";
29  public const TO_EXTRO_IMAGE = "extro/image/path";
30  public const TO_ONLINE = true;
31  public const TO_MEMBERS_GALLERY = true;
32 
34  {
35  $object = new ilLearningSequenceSettings(
36  self::TO_OBJ_ID,
37  self::TO_ABSTRACT,
38  self::TO_EXTRO,
39  self::TO_ABSTRACT_IMAGE,
40  self::TO_EXTRO_IMAGE,
41  self::TO_MEMBERS_GALLERY
42  );
43 
44  $this->assertEquals(self::TO_OBJ_ID, $object->getObjId());
45  $this->assertEquals(self::TO_ABSTRACT, $object->getAbstract());
46  $this->assertEquals(self::TO_EXTRO, $object->getExtro());
47  $this->assertEquals(self::TO_ABSTRACT_IMAGE, $object->getAbstractImage());
48  $this->assertEquals(self::TO_EXTRO_IMAGE, $object->getExtroImage());
49  $this->assertEquals(self::TO_MEMBERS_GALLERY, $object->getMembersGallery());
50 
51  return $object;
52  }
53 
57  public function testWithAbstract(ilLearningSequenceSettings $object): void
58  {
59  $new_object = $object->withAbstract("teststring");
60 
61  $this->assertEquals(self::TO_OBJ_ID, $object->getObjId());
62  $this->assertEquals(self::TO_ABSTRACT, $object->getAbstract());
63  $this->assertEquals(self::TO_EXTRO, $object->getExtro());
64  $this->assertEquals(self::TO_ABSTRACT_IMAGE, $object->getAbstractImage());
65  $this->assertEquals(self::TO_EXTRO_IMAGE, $object->getExtroImage());
66  $this->assertEquals(self::TO_MEMBERS_GALLERY, $object->getMembersGallery());
67 
68  $this->assertEquals(self::TO_OBJ_ID, $new_object->getObjId());
69  $this->assertEquals("teststring", $new_object->getAbstract());
70  $this->assertEquals(self::TO_EXTRO, $new_object->getExtro());
71  $this->assertEquals(self::TO_ABSTRACT_IMAGE, $new_object->getAbstractImage());
72  $this->assertEquals(self::TO_EXTRO_IMAGE, $new_object->getExtroImage());
73  $this->assertEquals(self::TO_MEMBERS_GALLERY, $new_object->getMembersGallery());
74  }
75 
79  public function testWithExtro(ilLearningSequenceSettings $object): void
80  {
81  $new_object = $object->withExtro("teststring");
82 
83  $this->assertEquals(self::TO_OBJ_ID, $object->getObjId());
84  $this->assertEquals(self::TO_ABSTRACT, $object->getAbstract());
85  $this->assertEquals(self::TO_EXTRO, $object->getExtro());
86  $this->assertEquals(self::TO_ABSTRACT_IMAGE, $object->getAbstractImage());
87  $this->assertEquals(self::TO_EXTRO_IMAGE, $object->getExtroImage());
88  $this->assertEquals(self::TO_MEMBERS_GALLERY, $object->getMembersGallery());
89 
90  $this->assertEquals(self::TO_OBJ_ID, $new_object->getObjId());
91  $this->assertEquals(self::TO_ABSTRACT, $new_object->getAbstract());
92  $this->assertEquals("teststring", $new_object->getExtro());
93  $this->assertEquals(self::TO_ABSTRACT_IMAGE, $new_object->getAbstractImage());
94  $this->assertEquals(self::TO_EXTRO_IMAGE, $new_object->getExtroImage());
95  $this->assertEquals(self::TO_MEMBERS_GALLERY, $new_object->getMembersGallery());
96  }
97 
101  public function testWithAbstractImage(ilLearningSequenceSettings $object): void
102  {
103  $new_object = $object->withAbstractImage("teststring");
104 
105  $this->assertEquals(self::TO_OBJ_ID, $object->getObjId());
106  $this->assertEquals(self::TO_ABSTRACT, $object->getAbstract());
107  $this->assertEquals(self::TO_EXTRO, $object->getExtro());
108  $this->assertEquals(self::TO_ABSTRACT_IMAGE, $object->getAbstractImage());
109  $this->assertEquals(self::TO_EXTRO_IMAGE, $object->getExtroImage());
110  $this->assertEquals(self::TO_MEMBERS_GALLERY, $object->getMembersGallery());
111 
112  $this->assertEquals(self::TO_OBJ_ID, $new_object->getObjId());
113  $this->assertEquals(self::TO_ABSTRACT, $new_object->getAbstract());
114  $this->assertEquals(self::TO_EXTRO, $new_object->getExtro());
115  $this->assertEquals("teststring", $new_object->getAbstractImage());
116  $this->assertEquals(self::TO_EXTRO_IMAGE, $new_object->getExtroImage());
117  $this->assertEquals(self::TO_MEMBERS_GALLERY, $new_object->getMembersGallery());
118  }
119 
123  public function testWithExtroImage(ilLearningSequenceSettings $object): void
124  {
125  $new_object = $object->withExtroImage("teststring");
126 
127  $this->assertEquals(self::TO_OBJ_ID, $object->getObjId());
128  $this->assertEquals(self::TO_ABSTRACT, $object->getAbstract());
129  $this->assertEquals(self::TO_EXTRO, $object->getExtro());
130  $this->assertEquals(self::TO_ABSTRACT_IMAGE, $object->getAbstractImage());
131  $this->assertEquals(self::TO_EXTRO_IMAGE, $object->getExtroImage());
132  $this->assertEquals(self::TO_MEMBERS_GALLERY, $object->getMembersGallery());
133 
134  $this->assertEquals(self::TO_OBJ_ID, $new_object->getObjId());
135  $this->assertEquals(self::TO_ABSTRACT, $new_object->getAbstract());
136  $this->assertEquals(self::TO_EXTRO, $new_object->getExtro());
137  $this->assertEquals(self::TO_ABSTRACT_IMAGE, $new_object->getAbstractImage());
138  $this->assertEquals("teststring", $new_object->getExtroImage());
139  $this->assertEquals(self::TO_MEMBERS_GALLERY, $new_object->getMembersGallery());
140  }
141 
145  public function testWithMembersGallery(ilLearningSequenceSettings $object): void
146  {
147  $new_object = $object->withMembersGallery(false);
148 
149  $this->assertEquals(self::TO_OBJ_ID, $object->getObjId());
150  $this->assertEquals(self::TO_ABSTRACT, $object->getAbstract());
151  $this->assertEquals(self::TO_EXTRO, $object->getExtro());
152  $this->assertEquals(self::TO_ABSTRACT_IMAGE, $object->getAbstractImage());
153  $this->assertEquals(self::TO_EXTRO_IMAGE, $object->getExtroImage());
154  $this->assertEquals(self::TO_MEMBERS_GALLERY, $object->getMembersGallery());
155 
156  $this->assertEquals(self::TO_OBJ_ID, $new_object->getObjId());
157  $this->assertEquals(self::TO_ABSTRACT, $new_object->getAbstract());
158  $this->assertEquals(self::TO_EXTRO, $new_object->getExtro());
159  $this->assertEquals(self::TO_ABSTRACT_IMAGE, $new_object->getAbstractImage());
160  $this->assertEquals(self::TO_EXTRO_IMAGE, $new_object->getExtroImage());
161  $this->assertEquals(false, $new_object->getMembersGallery());
162  }
163 }
testWithAbstract(ilLearningSequenceSettings $object)
testCreate
testWithAbstractImage(ilLearningSequenceSettings $object)
testCreate
Settings for an LSO (like abstract, extro)
testWithExtroImage(ilLearningSequenceSettings $object)
testCreate
testWithMembersGallery(ilLearningSequenceSettings $object)
testCreate
testWithExtro(ilLearningSequenceSettings $object)
testCreate