28 const START_OFFSET = 5;
35 protected function setUp()
37 $highlightState = M::mock(HighlightState::class);
38 $highlightState->shouldReceive(
"openExistingElements")->withAnyArgs()->andReturn(
"");
39 $highlightState->shouldReceive(
"closeOpenElements")->withAnyArgs()->andReturn(
"");
40 $this->result =
new PagedHexResult(self::START_OFFSET, $highlightState);
43 protected function tearDown()
48 public function testAddSmallAmountOfText()
50 $this->result->appendContentText(
"foo bar");
53 $this->result->getText(),
54 is(
"0x00000005 |66 6f 6f 20 62 61 72 __ __ __ __ __ __ __ __ __| |foo bar |"));
57 public function testAddOneHexLineOfText()
59 $this->result->appendContentText(
"foo bar baz done");
62 $this->result->getText(),
63 is(
"0x00000005 |66 6f 6f 20 62 61 72 20 62 61 7a 20 64 6f 6e 65| |foo bar baz done|<br/>\n"));
66 public function testAddMoreThanOneHexLineOfText()
68 $this->result->appendContentText(
"foo bar baz donefoo bar");
71 $this->result->getText(),
72 is(
"0x00000005 |66 6f 6f 20 62 61 72 20 62 61 7a 20 64 6f 6e 65| |foo bar baz done|<br/>\n" .
73 "0x00000015 |66 6f 6f 20 62 61 72 __ __ __ __ __ __ __ __ __| |foo bar |"));
76 public function testAddMetaText()
78 $this->result->appendContentText(
"foo ");
79 $this->result->appendMetaText(
"<b>");
80 $this->result->appendContentText(
"bar");
81 $this->result->appendMetaText(
"</b>");
82 $this->result->appendContentText(
"baz done");
85 $this->result->getText(),
86 is(
"0x00000005 |66 6f 6f 20 <b>62 61 72 </b>62 61 7a 20 64 6f 6e 65 __| |foo <b>bar</b>baz done |"));