public function flush() { if (null !== $this->reference) { throw new LogicException("Reference already flushed in token buffer"); } $this->reference = Reference::factory()->setLength($this->length)->setKey($this->value)->setText($this->text); return $this->resetBuffer(); }
/** * @expectedException \DomainException */ public function testSettingInvalidTypeThrowsSplException() { Reference::factory()->setType(0xff); }
/** */ public function testGotValueSameAsSet() { $value = 'abc'; $reference = Reference::factory()->setKey($value); $this->assertEquals($value, $reference->getKey(), "Got value differs from the one that was set"); }
/** * @expectedException \DomainException */ public function testSetNegativeLengthThrowsSplException() { Reference::factory()->setLength(-1); }
/** * @expectedException \LogicException */ public function testAccessingUninitializedIsLastThrowsSplException() { Reference::factory()->isLast(); }