ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
LSSettingsTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 class LSSettingsTest extends TestCase
27 {
28  public const TO_OBJ_ID = 10;
29  public const TO_ABSTRACT = "abstract";
30  public const TO_EXTRO = "extro";
31  public const TO_ABSTRACT_IMAGE = "abstract/image/path";
32  public const TO_EXTRO_IMAGE = "extro/image/path";
33  public const TO_ONLINE = true;
34  public const TO_MEMBERS_GALLERY = true;
35 
36  public function testCreate()
37  {
38  $object = new ilLearningSequenceSettings(
39  self::TO_OBJ_ID,
40  self::TO_ABSTRACT,
41  self::TO_EXTRO,
42  self::TO_ABSTRACT_IMAGE,
43  self::TO_EXTRO_IMAGE,
44  self::TO_ONLINE,
45  self::TO_MEMBERS_GALLERY
46  );
47 
48  $this->assertEquals($object->getObjId(), self::TO_OBJ_ID);
49  $this->assertEquals($object->getAbstract(), self::TO_ABSTRACT);
50  $this->assertEquals($object->getExtro(), self::TO_EXTRO);
51  $this->assertEquals($object->getAbstractImage(), self::TO_ABSTRACT_IMAGE);
52  $this->assertEquals($object->getExtroImage(), self::TO_EXTRO_IMAGE);
53  $this->assertEquals($object->getMembersGallery(), self::TO_MEMBERS_GALLERY);
54 
55  return $object;
56  }
57 
62  {
63  $new_object = $object->withAbstract("teststring");
64 
65  $this->assertEquals($object->getObjId(), self::TO_OBJ_ID);
66  $this->assertEquals($object->getAbstract(), self::TO_ABSTRACT);
67  $this->assertEquals($object->getExtro(), self::TO_EXTRO);
68  $this->assertEquals($object->getAbstractImage(), self::TO_ABSTRACT_IMAGE);
69  $this->assertEquals($object->getExtroImage(), self::TO_EXTRO_IMAGE);
70  $this->assertEquals($object->getMembersGallery(), self::TO_MEMBERS_GALLERY);
71 
72  $this->assertEquals($new_object->getObjId(), self::TO_OBJ_ID);
73  $this->assertEquals($new_object->getAbstract(), "teststring");
74  $this->assertEquals($new_object->getExtro(), self::TO_EXTRO);
75  $this->assertEquals($new_object->getAbstractImage(), self::TO_ABSTRACT_IMAGE);
76  $this->assertEquals($new_object->getExtroImage(), self::TO_EXTRO_IMAGE);
77  $this->assertEquals($new_object->getMembersGallery(), self::TO_MEMBERS_GALLERY);
78  }
79 
83  public function testWithExtro(ilLearningSequenceSettings $object)
84  {
85  $new_object = $object->withExtro("teststring");
86 
87  $this->assertEquals($object->getObjId(), self::TO_OBJ_ID);
88  $this->assertEquals($object->getAbstract(), self::TO_ABSTRACT);
89  $this->assertEquals($object->getExtro(), self::TO_EXTRO);
90  $this->assertEquals($object->getAbstractImage(), self::TO_ABSTRACT_IMAGE);
91  $this->assertEquals($object->getExtroImage(), self::TO_EXTRO_IMAGE);
92  $this->assertEquals($object->getMembersGallery(), self::TO_MEMBERS_GALLERY);
93 
94  $this->assertEquals($new_object->getObjId(), self::TO_OBJ_ID);
95  $this->assertEquals($new_object->getAbstract(), self::TO_ABSTRACT);
96  $this->assertEquals($new_object->getExtro(), "teststring");
97  $this->assertEquals($new_object->getAbstractImage(), self::TO_ABSTRACT_IMAGE);
98  $this->assertEquals($new_object->getExtroImage(), self::TO_EXTRO_IMAGE);
99  $this->assertEquals($new_object->getMembersGallery(), self::TO_MEMBERS_GALLERY);
100  }
101 
106  {
107  $new_object = $object->withAbstractImage("teststring");
108 
109  $this->assertEquals($object->getObjId(), self::TO_OBJ_ID);
110  $this->assertEquals($object->getAbstract(), self::TO_ABSTRACT);
111  $this->assertEquals($object->getExtro(), self::TO_EXTRO);
112  $this->assertEquals($object->getAbstractImage(), self::TO_ABSTRACT_IMAGE);
113  $this->assertEquals($object->getExtroImage(), self::TO_EXTRO_IMAGE);
114  $this->assertEquals($object->getMembersGallery(), self::TO_MEMBERS_GALLERY);
115 
116  $this->assertEquals($new_object->getObjId(), self::TO_OBJ_ID);
117  $this->assertEquals($new_object->getAbstract(), self::TO_ABSTRACT);
118  $this->assertEquals($new_object->getExtro(), self::TO_EXTRO);
119  $this->assertEquals($new_object->getAbstractImage(), "teststring");
120  $this->assertEquals($new_object->getExtroImage(), self::TO_EXTRO_IMAGE);
121  $this->assertEquals($new_object->getMembersGallery(), self::TO_MEMBERS_GALLERY);
122  }
123 
128  {
129  $new_object = $object->withExtroImage("teststring");
130 
131  $this->assertEquals($object->getObjId(), self::TO_OBJ_ID);
132  $this->assertEquals($object->getAbstract(), self::TO_ABSTRACT);
133  $this->assertEquals($object->getExtro(), self::TO_EXTRO);
134  $this->assertEquals($object->getAbstractImage(), self::TO_ABSTRACT_IMAGE);
135  $this->assertEquals($object->getExtroImage(), self::TO_EXTRO_IMAGE);
136  $this->assertEquals($object->getMembersGallery(), self::TO_MEMBERS_GALLERY);
137 
138  $this->assertEquals($new_object->getObjId(), self::TO_OBJ_ID);
139  $this->assertEquals($new_object->getAbstract(), self::TO_ABSTRACT);
140  $this->assertEquals($new_object->getExtro(), self::TO_EXTRO);
141  $this->assertEquals($new_object->getAbstractImage(), self::TO_ABSTRACT_IMAGE);
142  $this->assertEquals($new_object->getExtroImage(), "teststring");
143  $this->assertEquals($new_object->getMembersGallery(), self::TO_MEMBERS_GALLERY);
144  }
145 
150  {
151  $new_object = $object->withMembersGallery(false);
152 
153  $this->assertEquals($object->getObjId(), self::TO_OBJ_ID);
154  $this->assertEquals($object->getAbstract(), self::TO_ABSTRACT);
155  $this->assertEquals($object->getExtro(), self::TO_EXTRO);
156  $this->assertEquals($object->getAbstractImage(), self::TO_ABSTRACT_IMAGE);
157  $this->assertEquals($object->getExtroImage(), self::TO_EXTRO_IMAGE);
158  $this->assertEquals($object->getMembersGallery(), self::TO_MEMBERS_GALLERY);
159 
160  $this->assertEquals($new_object->getObjId(), self::TO_OBJ_ID);
161  $this->assertEquals($new_object->getAbstract(), self::TO_ABSTRACT);
162  $this->assertEquals($new_object->getExtro(), self::TO_EXTRO);
163  $this->assertEquals($new_object->getAbstractImage(), self::TO_ABSTRACT_IMAGE);
164  $this->assertEquals($new_object->getExtroImage(), self::TO_EXTRO_IMAGE);
165  $this->assertEquals($new_object->getMembersGallery(), false);
166  }
167 }
testWithMembersGallery(ilLearningSequenceSettings $object)
testCreate
testWithAbstract(ilLearningSequenceSettings $object)
testCreate
testWithAbstractImage(ilLearningSequenceSettings $object)
testCreate
testWithExtroImage(ilLearningSequenceSettings $object)
testCreate
Settings for an LSO (like abstract, extro)
testWithExtro(ilLearningSequenceSettings $object)
testCreate
const TO_MEMBERS_GALLERY