/** * @covers Opt_Xml_Buffer::getBuffer */ public function testGetBufferNullBuffers() { $buf1 = $this->_obj->getBuffer(Opt_Xml_Buffer::TAG_BEFORE); $buf2 = $this->_obj->getBuffer(Opt_Xml_Buffer::TAG_AFTER); $this->assertEquals(array(), $buf1); $this->assertEquals(array(), $buf2); }
/** * Copies an existing buffer from other node. * @param Opt_Xml_Buffer $from The external node that the buffer should be copied from. * @param Integer $fromBuffer The source buffer * @param Integer $toBuffer The destination buffer */ public function copyBuffer(Opt_Xml_Buffer $from, $fromBuffer, $toBuffer) { if (!is_array($this->_buffers)) { $this->_buffers = array(); } if (!isset($this->_buffers[$toBuffer])) { $this->_buffers[$toBuffer] = $from->getBuffer($fromBuffer); } else { $this->_buffers[$toBuffer] = array_merge($from->getBuffer($fromBuffer), $this->_buffers[$toBuffer]); } }