31 public function processMountInstructions(
string $a_raw_mount_instructions): array
45 $instructions =
'hello world';
49 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
52 $this->assertEquals($instructions, $parsed_instructions[0]);
62 $instructions =
'This is a start [tag] with no end tag';
66 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
69 $this->assertEquals($instructions, $parsed_instructions[0]);
79 $instructions =
'There is no start tag but an end [/tag] in the string';
83 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
86 $this->assertEquals($instructions, $parsed_instructions[0]);
96 $instrunction_text =
'This are the mount Instructions';
98 $start_tag =
"[$tag_title]";
99 $end_tag =
"[/$tag_title]";
100 $instructions = $start_tag . $instrunction_text . $end_tag;
104 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
107 $this->assertEquals($instrunction_text, $parsed_instructions[$tag_title]);
117 $instruction_text =
'This are the mount Instructions';
118 $tag_title =
'tag with spaces';
119 $start_tag =
"[$tag_title]";
120 $end_tag =
"[/$tag_title]";
121 $instructions = $start_tag . $instruction_text . $end_tag;
125 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
128 $this->assertEquals($instruction_text, $parsed_instructions[$tag_title]);
138 $instruction_text =
'This are the mount Instructions';
139 $tag_title =
'tag_w!th$pecial"chars?';
140 $start_tag =
"[$tag_title]";
141 $end_tag =
"[/$tag_title]";
142 $instructions = $start_tag . $instruction_text . $end_tag;
146 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
149 $this->assertEquals($instruction_text, $parsed_instructions[$tag_title]);
159 $instruction_text =
'This are the mount Instructions';
161 $start_tag =
"[$tag_title]";
162 $end_tag =
"[/$tag_title]";
163 $instructions =
'This will be cut off' . $start_tag . $instruction_text . $end_tag .
'and this of will be cut off as well';
167 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
170 $this->assertEquals($instruction_text, $parsed_instructions[$tag_title]);
180 $instruction_text =
'This are the mount Instructions';
182 $start_tag =
"[$tag_title]";
183 $end_tag =
"[/$tag_title]";
184 $instructions =
'Here is a [placeholder] hidden before the start tag' . $start_tag . $instruction_text . $end_tag;
188 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
191 $this->assertEquals($instruction_text, $parsed_instructions[$tag_title]);
201 $instruction_text1 =
'This are the first instructions';
202 $instruction_text2 =
'This are the second instructions\'';
203 $tag_title1 =
'tag1';
204 $start_tag1 =
"[$tag_title1]";
205 $end_tag1 =
"[/$tag_title1]";
206 $tag_title2 =
'tag2';
207 $start_tag2 =
"[$tag_title2]";
208 $end_tag2 =
"[/$tag_title2]";
209 $instructions = $start_tag1 . $instruction_text1 . $end_tag1 . $start_tag2 . $instruction_text2 . $end_tag2;
213 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
216 $this->assertEquals($instruction_text1, $parsed_instructions[$tag_title1]);
217 $this->assertEquals($instruction_text2, $parsed_instructions[$tag_title2]);
parseInstructionsToAssocArray_noOpenOnlyCloseTag_returnArrayOnlyWithInputString()
parseInstructionsToAssocArray_onlyOpenNoCloseTag_returnArrayOnlyWithInputString()
createDocumentProcessorBaseObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
parseInstructionsToAssocArray_tagsContainSpecialChars_returnArrayOnlyWithInputString()
parseInstructionsToAssocArray_noOpenNoCloseTags_returnArrayOnlyWithInputString()
parseInstructionsToAssocArray_openTagAtStartCloseTagAtEnd_returnArrayOnlyWithInputString()
parseInstructionsToAssocArray_beforeStartTagAndAfterEndTagIsText_returnArrayOnlyWithStringBetweenTags()
parseInstructionsToAssocArray_tagsContainSpaces_returnArrayOnlyWithInputString()
parseInstructionsToAssocArray_placeholderBeforeStartTag_returnArrayOnlyWithStringBetweenTags()
parseInstructionsToAssocArray_withTwoOpenAndCloseTags_returnArrayWithBothInstructions()