3 use \PHPUnit\Framework\TestCase;
4 use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
10 return new class extends ilWebDAVMountInstructionsDocumentProcessorBase {
11 public function processMountInstructions(
string $a_raw_mount_instructions) : array
25 $instructions =
'hello world';
29 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
32 $this->assertEquals($instructions, $parsed_instructions[0]);
42 $instructions =
'This is a start [tag] with no end tag';
46 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
49 $this->assertEquals($instructions, $parsed_instructions[0]);
59 $instructions =
'There is no start tag but an end [/tag] in the string';
63 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
66 $this->assertEquals($instructions, $parsed_instructions[0]);
76 $instrunction_text =
'This are the mount Instructions';
78 $start_tag =
"[$tag_title]";
79 $end_tag =
"[/$tag_title]";
80 $instructions = $start_tag . $instrunction_text . $end_tag;
84 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
87 $this->assertEquals($instrunction_text, $parsed_instructions[$tag_title]);
97 $instruction_text =
'This are the mount Instructions';
98 $tag_title =
'tag with spaces';
99 $start_tag =
"[$tag_title]";
100 $end_tag =
"[/$tag_title]";
101 $instructions = $start_tag . $instruction_text . $end_tag;
105 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
108 $this->assertEquals($instruction_text, $parsed_instructions[$tag_title]);
118 $instruction_text =
'This are the mount Instructions';
119 $tag_title =
'tag_w!th$pecial"chars?';
120 $start_tag =
"[$tag_title]";
121 $end_tag =
"[/$tag_title]";
122 $instructions = $start_tag . $instruction_text . $end_tag;
126 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
129 $this->assertEquals($instruction_text, $parsed_instructions[$tag_title]);
139 $instruction_text =
'This are the mount Instructions';
141 $start_tag =
"[$tag_title]";
142 $end_tag =
"[/$tag_title]";
143 $instructions =
'This will be cut off' . $start_tag . $instruction_text . $end_tag .
'and this of will be cut off as well';
147 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
150 $this->assertEquals($instruction_text, $parsed_instructions[$tag_title]);
160 $instruction_text =
'This are the mount Instructions';
162 $start_tag =
"[$tag_title]";
163 $end_tag =
"[/$tag_title]";
164 $instructions =
'Here is a [placeholder] hidden before the start tag' . $start_tag . $instruction_text . $end_tag;
168 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
171 $this->assertEquals($instruction_text, $parsed_instructions[$tag_title]);
181 $instruction_text1 =
'This are the first instructions';
182 $instruction_text2 =
'This are the second instructions\'';
183 $tag_title1 =
'tag1';
184 $start_tag1 =
"[$tag_title1]";
185 $end_tag1 =
"[/$tag_title1]";
186 $tag_title2 =
'tag2';
187 $start_tag2 =
"[$tag_title2]";
188 $end_tag2 =
"[/$tag_title2]";
189 $instructions = $start_tag1 . $instruction_text1 . $end_tag1 . $start_tag2 . $instruction_text2 . $end_tag2;
193 $parsed_instructions = $doc_processor->parseInstructionsToAssocArray($instructions);
196 $this->assertEquals($instruction_text1, $parsed_instructions[$tag_title1]);
197 $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()