예제 #1
0
 protected function setUp()
 {
     $highlightState = M::mock(HighlightState::className());
     $highlightState->shouldReceive("openExistingElements")->withAnyArgs()->andReturn("");
     $highlightState->shouldReceive("closeOpenElements")->withAnyArgs()->andReturn("");
     $this->result = new PagedHexResult(self::START_OFFSET, $highlightState);
 }
예제 #2
0
 /**
  * @param TextFragment $fragment
  * @param HighlightState $state
  * @param PagedResult $result
  */
 protected function finalizeContentText(TextFragment $fragment, HighlightState $state, PagedResult $result)
 {
     if ($result->getCurrentOffset() < $fragment->getEndOffset()) {
         if ($result->isEmpty()) {
             $state->openExistingElements($result);
         }
         $result->appendContentText($fragment->getSlice($result->getCurrentOffset()));
         $state->closeOpenElements($result);
     }
 }