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();
 }
Example #2
0
 /**
  * @expectedException \DomainException
  */
 public function testSettingInvalidTypeThrowsSplException()
 {
     Reference::factory()->setType(0xff);
 }
Example #3
0
 /**
  */
 public function testGotValueSameAsSet()
 {
     $value = 'abc';
     $reference = Reference::factory()->setKey($value);
     $this->assertEquals($value, $reference->getKey(), "Got value differs from the one that was set");
 }
Example #4
0
 /**
  * @expectedException \DomainException
  */
 public function testSetNegativeLengthThrowsSplException()
 {
     Reference::factory()->setLength(-1);
 }
Example #5
0
 /**
  * @expectedException \LogicException
  */
 public function testAccessingUninitializedIsLastThrowsSplException()
 {
     Reference::factory()->isLast();
 }