Test _input2xml.
96 : void
97 {
98 $cases = [
99 ''
100 => '',
101 'xx'
102 => 'xx',
103
104
105 'xx [str]xx[/str] xx'
106 => 'xx <Strong>xx</Strong> xx',
107 'xx [com]xx[/com] xx'
108 => 'xx <Comment>xx</Comment> xx',
109 'xx [emp]xx[/emp] xx'
110 => 'xx <Emph>xx</Emph> xx',
111 'xx [fn]xx[/fn] xx'
112 => 'xx <Footnote>xx</Footnote> xx',
113 'xx [code]xx[/code] xx'
114 => 'xx <Code>xx</Code> xx',
115 'xx [acc]xx[/acc] xx'
116 => 'xx <Accent>xx</Accent> xx',
117 'xx [imp]xx[/imp] xx'
118 => 'xx <Important>xx</Important> xx',
119 'xx [kw]xx[/kw] xx'
120 => 'xx <Keyw>xx</Keyw> xx',
121 'xx [sub]xx[/sub] xx'
122 => 'xx <Sub>xx</Sub> xx',
123 'xx [sup]xx[/sup] xx'
124 => 'xx <Sup>xx</Sup> xx',
125 'xx [quot]xx[/quot] xx'
126 => 'xx <Quotation>xx</Quotation> xx',
127
128
129 'xx [iln cat="106"] xx [/iln] xx'
130 => 'xx <IntLink Target="il__obj_106" Type="RepositoryItem"> xx </IntLink> xx',
131 'xx [iln page="106"] xx [/iln] xx'
132 => 'xx <IntLink Target="il__pg_106" Type="PageObject"> xx </IntLink> xx',
133 'xx [iln page="106"] xx xx'
134 => 'xx xx xx',
135 'xx xx [/iln] xx'
136 => 'xx xx [/iln] xx',
137 'xx [iln chap="106"] xx [/iln] xx'
138 => 'xx <IntLink Target="il__st_106" Type="StructureObject"> xx </IntLink> xx',
139 'xx [iln inst="123" page="106"] xx [/iln] xx'
140 => 'xx <IntLink Target="il_123_pg_106" Type="PageObject"> xx </IntLink> xx',
141 'xx [iln page="106" target="FAQ"] xx [/iln] xx'
142 => 'xx <IntLink Target="il__pg_106" Type="PageObject" TargetFrame="FAQ"> xx </IntLink> xx',
143 'xx [iln page="106" target="New" anchor="test"] xx [/iln] xx'
144 => 'xx <IntLink Target="il__pg_106" Type="PageObject" TargetFrame="New" Anchor="test"> xx </IntLink> xx',
145 'xx [iln term="106"] xx [/iln] xx'
146 => 'xx <IntLink Target="il__git_106" Type="GlossaryItem" TargetFrame="Glossary"> xx </IntLink> xx',
147 'xx [iln term="106" target="New"] xx [/iln] xx'
148 => 'xx <IntLink Target="il__git_106" Type="GlossaryItem" TargetFrame="New"> xx </IntLink> xx',
149 'xx [iln wpage="106"] xx [/iln] xx'
150 => 'xx <IntLink Target="il__wpage_106" Type="WikiPage"> xx </IntLink> xx',
151 'xx [iln wpage="106" anchor="test"] xx [/iln] xx'
152 => 'xx <IntLink Target="il__wpage_106" Type="WikiPage" Anchor="test"> xx </IntLink> xx',
153 'xx [iln ppage="106"] xx [/iln] xx'
154 => 'xx <IntLink Target="il__ppage_106" Type="PortfolioPage"> xx </IntLink> xx',
155 'xx [iln media="545"/] xx '
156 => 'xx <IntLink Target="il__mob_545" Type="MediaObject"/> xx',
157 'xx [iln media="108" target="New"] xx [/iln] xx'
158 => 'xx <IntLink Target="il__mob_108" Type="MediaObject" TargetFrame="New"> xx </IntLink> xx',
159 'xx [iln media="108" target="Media"] xx [/iln] xx'
160 => 'xx <IntLink Target="il__mob_108" Type="MediaObject" TargetFrame="Media"> xx </IntLink> xx',
161 'xx [iln dfile="546"] xx [/iln] xx'
162 => 'xx <IntLink Target="il__dfile_546" Type="File"> xx </IntLink> xx',
163
164
165 'xx' . chr(13) . chr(10) . 'yy'
166 => 'xx<br />yy',
167 'xx' . chr(13) . 'yy'
168 => 'xx<br />yy',
169 'xx' . chr(10) . 'yy'
170 => 'xx<br />yy',
171
172
173 '<ul class="ilc_list_u_BulletedList"><li class="ilc_list_item_StandardListItem">aa</li><li class="ilc_list_item_StandardListItem">bb</li><li class="ilc_list_item_StandardListItem">cc</li></ul>'
174 => '<ul class="ilc_list_u_BulletedList"><li class="ilc_list_item_StandardListItem">aa</li><li class="ilc_list_item_StandardListItem">bb</li><li class="ilc_list_item_StandardListItem">cc</li></ul>',
175
176
177 'xx [xln url="http://"][/xln] xxxx'
178 => 'xx xxxx',
179 'xx [xln url="http://ilias.de"]www[/xln] xxxx'
180 => 'xx <ExtLink Href="http://ilias.de">www</ExtLink> xxxx',
181 'xx [xln url="http://ilias.php?x=1&y=2"]www[/xln] xxxx'
182 => 'xx <ExtLink Href="http://ilias.php?x=1&y=2">www</ExtLink> xxxx',
183 'xx [xln url="http://ilias.de/my+document.pdf"]doc[/xln] xxxx'
184 => 'xx <ExtLink Href="http://ilias.de/my+document.pdf">doc</ExtLink> xxxx',
185
186
187 'xx [anc name="test"]test[/anc] xxxx'
188 => 'xx <Anchor Name="test">test</Anchor> xxxx',
189
190
191 'xx [marked class="test"]test[/marked] xxxx'
192 => 'xx <Marked Class="test">test</Marked> xxxx',
193
194
195
196
197
198
199 ];
200
201 foreach ($cases as $in => $expected) {
203 $this->assertEquals(
204 $expected,
206 );
207 }
208 }