function GenerateResult($InputText, $StartChar, $SelectionSize, $Tag) { $SelectedText = TakeOnePartOfAString($InputText, $StartChar, $SelectionSize); $NewString = AdATagOnAString($Tag, $SelectedText); $WaitedText = str_replace($SelectedText, $NewString, $InputText); return $WaitedText; }
function TestLocateAPartOfInputTextOnTheFirstLine() { $SelectedPartOfTheString = TakeOnePartOfAString(TakeAllDatasInAFile(INPUT_FILE), 3, 8); $this->assertEqual($SelectedPartOfTheString, "lo World"); $SelectedOtherOfTheString = TakeOnePartOfAString(TakeAllDatasInAFile(INPUT_FILE), 0, 36); $this->assertEqual($SelectedOtherOfTheString, "Hello World I'm Luc\r\nI live In Paris"); }