public function testIsStarted()
 {
     $this->assertEquals(FALSE, fBuffer::isStarted());
     fBuffer::start();
     $this->started_buffer = TRUE;
     $this->assertEquals(TRUE, fBuffer::isStarted());
 }
Example #2
0
 /**
  * Enables buffered output, allowing ::set() and ::add() to happen after a ::place() but act as if they were done before
  * 
  * Please note that using buffered output will affect the order in which
  * code is executed since the elements are not actually ::place()'ed until
  * the destructor is called.
  * 
  * If the non-template code depends on template code being executed
  * sequentially before it, you may not want to use output buffering.
  * 
  * @return void
  */
 public function buffer()
 {
     static $id_sequence = 1;
     if ($this->buffered_id) {
         throw new fProgrammerException('Buffering has already been started');
     }
     if (!fBuffer::isStarted()) {
         fBuffer::start();
     }
     $this->buffered_id = $id_sequence;
     $id_sequence++;
 }