38 const START_OFFSET = 12;
39 const META_TEXT =
"<meta>";
40 const CONTENT_TEXT =
"<content>";
45 protected function setUp()
50 public function testGetStartOffset()
52 assertThat($this->pagedResult->getStartOffset(), is(self::START_OFFSET));
55 public function testIsEmpty()
57 $this->assertTrue($this->pagedResult->isEmpty());
59 $this->pagedResult->appendMetaText(self::META_TEXT);
61 $this->assertTrue($this->pagedResult->isEmpty());
63 $this->pagedResult->appendContentText(self::CONTENT_TEXT);
65 $this->assertFalse($this->pagedResult->isEmpty());
68 public function testAppendMetaText()
70 $this->pagedResult->appendMetaText(self::META_TEXT);
72 assertThat($this->pagedResult->getCurrentOffset(), is(self::START_OFFSET));
73 assertThat($this->pagedResult->getText(), is(self::META_TEXT));
76 public function testAppendContentText()
78 $this->pagedResult->appendContentText(self::CONTENT_TEXT);
80 assertThat($this->pagedResult->getCurrentOffset(), is(self::START_OFFSET + strlen(self::CONTENT_TEXT)));
81 assertThat($this->pagedResult->getText(), is(self::CONTENT_TEXT));
84 public function testAppendContentAndMetaText()
86 $this->pagedResult->appendContentText(self::CONTENT_TEXT);
87 $this->pagedResult->appendMetaText(self::META_TEXT);
89 assertThat($this->pagedResult->getCurrentOffset(), is(self::START_OFFSET + strlen(self::CONTENT_TEXT)));
90 assertThat($this->pagedResult->getText(), is(self::CONTENT_TEXT . self::META_TEXT));
93 public function testAppendMetaAndContentText()
95 $this->pagedResult->appendMetaText(self::META_TEXT);
96 $this->pagedResult->appendContentText(self::CONTENT_TEXT);
98 assertThat($this->pagedResult->getCurrentOffset(), is(self::START_OFFSET + strlen(self::CONTENT_TEXT)));
99 assertThat($this->pagedResult->getText(), is(self::META_TEXT . self::CONTENT_TEXT));