ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCertificateSettingsCourseFormRepositoryTest Class Reference
+ Inheritance diagram for ilCertificateSettingsCourseFormRepositoryTest:
+ Collaboration diagram for ilCertificateSettingsCourseFormRepositoryTest:

Public Member Functions

 testSaveSettings ()
 
 testFetchFormFieldData ()
 

Detailed Description

Member Function Documentation

◆ testFetchFormFieldData()

ilCertificateSettingsCourseFormRepositoryTest::testFetchFormFieldData ( )

Definition at line 102 of file ilCertificateSettingsCourseFormRepositoryTest.php.

References $result.

103  {
104  $object = $this->getMockBuilder('ilObject')
105  ->disableOriginalConstructor()
106  ->getMock();
107 
108  $object
109  ->expects($this->atLeastOnce())
110  ->method('getId')
111  ->willReturn(100);
112 
113  $language = $this->getMockBuilder('ilLanguage')
114  ->disableOriginalConstructor()
115  ->getMock();
116 
117  $controller = $this->getMockBuilder('ilCtrl')
118  ->disableOriginalConstructor()
119  ->getMock();
120 
121  $access = $this->getMockBuilder('ilAccess')
122  ->disableOriginalConstructor()
123  ->getMock();
124 
125  $toolbar = $this->getMockBuilder('ilToolbarGUI')
126  ->disableOriginalConstructor()
127  ->getMock();
128 
129  $placeholderDescriptionObject = $this->getMockBuilder('ilCertificatePlaceholderDescription')
130  ->disableOriginalConstructor()
131  ->getMock();
132 
133  $leaningProgressObject = $this->getMockBuilder('ilObjectLP')
134  ->disableOriginalConstructor()
135  ->getMock();
136 
137  $settingsFormFactory = $this->getMockBuilder('ilCertificateSettingsFormRepository')
138  ->disableOriginalConstructor()
139  ->getMock();
140 
141  $settingsFormFactory
142  ->expects($this->atLeastOnce())
143  ->method('fetchFormFieldData')
144  ->willReturn(
145  array(
146  'subitems' => array(),
147  'something_else' => 'something'
148  )
149  );
150 
151  $trackingHelper = $this->getMockBuilder('ilCertificateObjUserTrackingHelper')
152  ->disableOriginalConstructor()
153  ->getMock();
154 
155  $objectHelper = $this->getMockBuilder('ilCertificateObjectHelper')
156  ->disableOriginalConstructor()
157  ->getMock();
158 
159  $lpHelper = $this->getMockBuilder('ilCertificateObjectLPHelper')
160  ->disableOriginalConstructor()
161  ->getMock();
162 
163  $tree = $this->getMockBuilder('ilTree')
164  ->disableOriginalConstructor()
165  ->getMock();
166 
167  $setting = $this->getMockBuilder('ilSetting')
168  ->disableOriginalConstructor()
169  ->getMock();
170 
171  $setting
172  ->expects($this->atLeastOnce())
173  ->method('get')
174  ->willReturn('[1, 2, 3]');
175 
177  $object,
178  '/some/where',
179  false,
180  $language,
181  $controller,
182  $access,
183  $toolbar,
184  $placeholderDescriptionObject,
185  $leaningProgressObject,
186  $settingsFormFactory,
187  $trackingHelper,
188  $objectHelper,
189  $lpHelper,
190  $tree,
191  $setting
192  );
193 
194  $result = $repository->fetchFormFieldData('Some Content');
195 
196  $this->assertEquals(
197  array(
198  'subitems' => array(1, 2, 3),
199  'something_else' => 'something'
200  ),
201  $result
202  );
203  }
$result

◆ testSaveSettings()

ilCertificateSettingsCourseFormRepositoryTest::testSaveSettings ( )

Definition at line 9 of file ilCertificateSettingsCourseFormRepositoryTest.php.

10  {
11  $object = $this->getMockBuilder('ilObject')
12  ->disableOriginalConstructor()
13  ->getMock();
14 
15  $object
16  ->expects($this->atLeastOnce())
17  ->method('getId')
18  ->willReturn(100);
19 
20  $language = $this->getMockBuilder('ilLanguage')
21  ->disableOriginalConstructor()
22  ->getMock();
23 
24  $controller = $this->getMockBuilder('ilCtrl')
25  ->disableOriginalConstructor()
26  ->getMock();
27 
28  $access = $this->getMockBuilder('ilAccess')
29  ->disableOriginalConstructor()
30  ->getMock();
31 
32  $toolbar = $this->getMockBuilder('ilToolbarGUI')
33  ->disableOriginalConstructor()
34  ->getMock();
35 
36  $placeholderDescriptionObject = $this->getMockBuilder('ilCertificatePlaceholderDescription')
37  ->disableOriginalConstructor()
38  ->getMock();
39 
40  $leaningProgressObject = $this->getMockBuilder('ilObjectLP')
41  ->disableOriginalConstructor()
42  ->getMock();
43 
44  $settingsFormFactory = $this->getMockBuilder('ilCertificateSettingsFormRepository')
45  ->disableOriginalConstructor()
46  ->getMock();
47 
48  $trackingHelper = $this->getMockBuilder('ilCertificateObjUserTrackingHelper')
49  ->disableOriginalConstructor()
50  ->getMock();
51 
52  $objectHelper = $this->getMockBuilder('ilCertificateObjectHelper')
53  ->disableOriginalConstructor()
54  ->getMock();
55 
56  $lpHelper = $this->getMockBuilder('ilCertificateObjectLPHelper')
57  ->disableOriginalConstructor()
58  ->getMock();
59 
60  $lpMock = $this->getMockBuilder('ilObjectLP')
61  ->disableOriginalConstructor()
62  ->getMock();
63 
64  $lpMock->method('getCurrentMode')
65  ->willReturn(100);
66 
67  $lpHelper->method('getInstance')->willReturn($lpMock);
68 
69  $tree = $this->getMockBuilder('ilTree')
70  ->disableOriginalConstructor()
71  ->getMock();
72 
73  $setting = $this->getMockBuilder('ilSetting')
74  ->disableOriginalConstructor()
75  ->getMock();
76 
77  $setting
78  ->expects($this->atLeastOnce())
79  ->method('set');
80 
82  $object,
83  '/some/where',
84  false,
85  $language,
86  $controller,
87  $access,
88  $toolbar,
89  $placeholderDescriptionObject,
90  $leaningProgressObject,
91  $settingsFormFactory,
92  $trackingHelper,
93  $objectHelper,
94  $lpHelper,
95  $tree,
96  $setting
97  );
98 
99  $repository->save(array('subitems' => array(1, 2, 3)));
100  }

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