ILIAS  release_8 Revision v8.24
ilExercisePlaceholderDescriptionTest Class Reference
+ Inheritance diagram for ilExercisePlaceholderDescriptionTest:
+ Collaboration diagram for ilExercisePlaceholderDescriptionTest:

Public Member Functions

 testPlaceholderGetHtmlDescription ()
 
 testPlaceholderDescriptions ()
 

Detailed Description

Member Function Documentation

◆ testPlaceholderDescriptions()

ilExercisePlaceholderDescriptionTest::testPlaceholderDescriptions ( )

Definition at line 57 of file ilExercisePlaceholderDescriptionTest.php.

57 : void
58 {
59 $languageMock = $this->getMockBuilder(ilLanguage::class)
60 ->disableOriginalConstructor()
61 ->onlyMethods(['txt', 'loadLanguageModule'])
62 ->getMock();
63
64 $languageMock->expects($this->exactly(21))
65 ->method('txt')
66 ->willReturn('Something translated');
67
68 $userDefinePlaceholderMock = $this->getMockBuilder(ilUserDefinedFieldsPlaceholderDescription::class)
69 ->disableOriginalConstructor()
70 ->getMock();
71
72 $userDefinePlaceholderMock->method('createPlaceholderHtmlDescription')
73 ->willReturn('');
74
75 $userDefinePlaceholderMock->method('getPlaceholderDescriptions')
76 ->willReturn([]);
77
78 $placeholderDescriptionObject = new ilExercisePlaceholderDescription(null, $languageMock, $userDefinePlaceholderMock);
79
80 $placeHolders = $placeholderDescriptionObject->getPlaceholderDescriptions();
81
82 $this->assertSame(
83 [
84 'USER_LOGIN' => 'Something translated',
85 'USER_FULLNAME' => 'Something translated',
86 'USER_FIRSTNAME' => 'Something translated',
87 'USER_LASTNAME' => 'Something translated',
88 'USER_TITLE' => 'Something translated',
89 'USER_SALUTATION' => 'Something translated',
90 'USER_BIRTHDAY' => 'Something translated',
91 'USER_INSTITUTION' => 'Something translated',
92 'USER_DEPARTMENT' => 'Something translated',
93 'USER_STREET' => 'Something translated',
94 'USER_CITY' => 'Something translated',
95 'USER_ZIPCODE' => 'Something translated',
96 'USER_COUNTRY' => 'Something translated',
97 'USER_MATRICULATION' => 'Something translated',
98 'DATE' => 'Something translated',
99 'DATETIME' => 'Something translated',
100 'RESULT_PASSED' => 'Something translated',
101 'RESULT_MARK' => 'Something translated',
102 'EXERCISE_TITLE' => 'Something translated',
103 'DATE_COMPLETED' => 'Something translated',
104 'DATETIME_COMPLETED' => 'Something translated'
105 ],
106 $placeHolders
107 );
108 }

◆ testPlaceholderGetHtmlDescription()

ilExercisePlaceholderDescriptionTest::testPlaceholderGetHtmlDescription ( )

Definition at line 26 of file ilExercisePlaceholderDescriptionTest.php.

26 : void
27 {
28 $languageMock = $this->getMockBuilder(ilLanguage::class)
29 ->disableOriginalConstructor()
30 ->onlyMethods(['txt', 'loadLanguageModule'])
31 ->getMock();
32
33 $templateMock = $this->getMockBuilder(ilTemplate::class)
34 ->disableOriginalConstructor()
35 ->getMock();
36
37 $userDefinePlaceholderMock = $this->getMockBuilder(ilUserDefinedFieldsPlaceholderDescription::class)
38 ->disableOriginalConstructor()
39 ->getMock();
40
41 $userDefinePlaceholderMock->method('createPlaceholderHtmlDescription')
42 ->willReturn('');
43
44 $userDefinePlaceholderMock->method('getPlaceholderDescriptions')
45 ->willReturn([]);
46
47 $templateMock->method('get')
48 ->willReturn('');
49
50 $placeholderDescriptionObject = new ilExercisePlaceholderDescription(null, $languageMock, $userDefinePlaceholderMock);
51
52 $html = $placeholderDescriptionObject->createPlaceholderHtmlDescription($templateMock);
53
54 $this->assertSame('', $html);
55 }

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