30 public function processMountInstructions(
string $a_raw_mount_instructions): array
44 $instructions =
'hello world';
48 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
51 $this->assertEquals($instructions, $parsed_instructions[0]);
61 $instructions =
'This is a start [tag] with no end tag';
65 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
68 $this->assertEquals($instructions, $parsed_instructions[0]);
78 $instructions =
'There is no start tag but an end [/tag] in the string';
82 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
85 $this->assertEquals($instructions, $parsed_instructions[0]);
95 $instrunction_text =
'This are the mount Instructions';
97 $start_tag =
"[$tag_title]";
98 $end_tag =
"[/$tag_title]";
99 $instructions = $start_tag . $instrunction_text . $end_tag;
103 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
106 $this->assertEquals($instrunction_text, $parsed_instructions[$tag_title]);
116 $instruction_text =
'This are the mount Instructions';
117 $tag_title =
'tag with spaces';
118 $start_tag =
"[$tag_title]";
119 $end_tag =
"[/$tag_title]";
120 $instructions = $start_tag . $instruction_text . $end_tag;
124 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
127 $this->assertEquals($instruction_text, $parsed_instructions[$tag_title]);
137 $instruction_text =
'This are the mount Instructions';
138 $tag_title =
'tag_w!th$pecial"chars?';
139 $start_tag =
"[$tag_title]";
140 $end_tag =
"[/$tag_title]";
141 $instructions = $start_tag . $instruction_text . $end_tag;
145 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
148 $this->assertEquals($instruction_text, $parsed_instructions[$tag_title]);
158 $instruction_text =
'This are the mount Instructions';
160 $start_tag =
"[$tag_title]";
161 $end_tag =
"[/$tag_title]";
162 $instructions =
'This will be cut off' . $start_tag . $instruction_text . $end_tag .
'and this of will be cut off as well';
166 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
169 $this->assertEquals($instruction_text, $parsed_instructions[$tag_title]);
179 $instruction_text =
'This are the mount Instructions';
181 $start_tag =
"[$tag_title]";
182 $end_tag =
"[/$tag_title]";
183 $instructions =
'Here is a [placeholder] hidden before the start tag' . $start_tag . $instruction_text . $end_tag;
187 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
190 $this->assertEquals($instruction_text, $parsed_instructions[$tag_title]);
200 $instruction_text1 =
'This are the first instructions';
201 $instruction_text2 =
'This are the second instructions\'';
202 $tag_title1 =
'tag1';
203 $start_tag1 =
"[$tag_title1]";
204 $end_tag1 =
"[/$tag_title1]";
205 $tag_title2 =
'tag2';
206 $start_tag2 =
"[$tag_title2]";
207 $end_tag2 =
"[/$tag_title2]";
208 $instructions = $start_tag1 . $instruction_text1 . $end_tag1 . $start_tag2 . $instruction_text2 . $end_tag2;
212 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
215 $this->assertEquals($instruction_text1, $parsed_instructions[$tag_title1]);
216 $this->assertEquals($instruction_text2, $parsed_instructions[$tag_title2]);
parseInstructionsToAssocArray_noOpenOnlyCloseTag_returnArrayOnlyWithInputString()
parseInstructionsToAssocArray_onlyOpenNoCloseTag_returnArrayOnlyWithInputString()
createDocumentProcessorBaseObject()
parseInstructionsToAssocArray_tagsContainSpecialChars_returnArrayOnlyWithInputString()
parseInstructionsToAssocArray_noOpenNoCloseTags_returnArrayOnlyWithInputString()
parseInstructionsToAssocArray_openTagAtStartCloseTagAtEnd_returnArrayOnlyWithInputString()
parseInstructionsToAssocArray_beforeStartTagAndAfterEndTagIsText_returnArrayOnlyWithStringBetweenTags()
parseInstructionsToAssocArray_tagsContainSpaces_returnArrayOnlyWithInputString()
parseInstructionsToAssocArray_placeholderBeforeStartTag_returnArrayOnlyWithStringBetweenTags()
parseInstructionsToAssocArray_withTwoOpenAndCloseTags_returnArrayWithBothInstructions()