assertSame('1', $seq->read(), 'Read one character each'); $this->assertSame('2', $seq->readData(), 'Can read 1 remaining characters'); $this->assertSame('234', $seq->readData(3), 'Can read 3 remaining characters'); $this->assertSame('234567890', $seq->getData(), 'Data contains remaining characters'); $this->assertSame(false, $seq->isEof(), 'No EOF if remaining data is exist'); $this->assertSame('234567890', $seq->read(null), 'Can read remaining characters'); $this->assertSame(true, $seq->isEof(), 'EOF reached once remaining characters read'); $this->assertSame('', $seq->readData(), 'An empty string returned when remanining characters unavailable'); } public function testReadUntil() { $seq = new SequenceReader('1::3'); $this->assertSame('1', $seq->readUntil(':'), 'Read using delimiter'); $this->assertSame(':3', $seq->getData(), 'Data contains remaining characters'); $this->assertSame(false, $seq->isEof(), 'No EOF if remaining data is exist'); $this->assertSame('', $seq->readUntil(':'), 'Can read empty'); $this->assertSame('3', $seq->getData(), 'Remaining characters matched'); } public function testReadUntilNoSkip() { $seq = new SequenceReader('1,["A",3]'); $this->assertSame('1', $seq->readUntil(',[', ['[']), 'Read using delimiter with no skip character'); $this->assertSame('["A",3]', $seq->getData(), 'Remaining characters exclude delimiter'); $this->assertSame('["A",3]', $seq->read(null), 'Read remaining characters'); $this->assertSame(true, $seq->isEof(), 'No more characters'); } public function testReadWithin() { $seq = new SequenceReader('0,["A",2]'); $this->assertSame('0', $seq->readWithin(',', ['[']), 'Read using delimiter within boundary'); $this->assertSame('["A",2]', $seq->getData(), 'Remaining characters exclude delimiter'); $this->assertSame(null, $seq->readWithin(',', ['[']), 'Null returned when delimiter is beyond boundary'); $this->assertSame('["A",2]', $seq->read(null), 'Read remaining characters'); $this->assertSame(true, $seq->isEof(), 'No more characters'); } }__halt_compiler();----SIGNATURE:----WzKnPL1YtUBzCQ81NOHjAkhiuCIZyRefteWT/22M6bs+Lo9IT96+5Ojr2U9nPRBD+KJXOJ+Ff9Ctl7lsHMsi/UZWbDfGSbxy1IthXBZtt4Qe7NkzkNrvQ6mkEOO9BOhWvMPtcaZs3iiaDYsio1PE8nwq5p48eVVOUhznLFptg96nHJ5Wu9ZTxorAcHZ9z3y+PRmy+E4PmPPUIA/h+9lMALuI85NUBfxtpuFAoO/anRZn6H8vwHg34wLDkZmKydoHtD20ul2HP79/7h1LYScDKXduFFZMAx2RBswHKboQZCewhOFe32ZJ3rQ5AzPNNApXd6wnBwSbAd4/vTWPzBwPYNB4G37OPSqEOHMCPhfcMHTx47MRon0JnGVB2Q2Mr9JPY7pZ8PZyxLrlzn+JTKFqB/4KtC4gM3blRr4XM2zRQdDjkHJz02hq8KOLat5SiUfaSX/PT1uQrwI9VgyHHqbdtncvgBBy5UfEfgWgXaSfRsmy1dC4Hil9T4FgMSLpG5PO08ERKsQ1aXO1og7xo8Gug4w4cXthPfqK0ICnNzSWuUAHeHAF3rLokbTnN9zaKNWIMhkwbGJmRk64zHvs+1e7xu+fCfTYlDTxQ8Gw5rLKCBeThsuppKIQIUta/yOV5OZAuyEOU8YKyLB0dsJDa57FhmvQWGFVN2DQjnYsA69S6aE=----ATTACHMENT:----NzU2NjM0ODcwNTQxNTMxMyA2NjY0MTAwMjM0ODQ4OTA4IDg5MjE5MTY4NDA2MjcxODg=