Example #1
0
 public function testBufferAddMixed()
 {
     $buffer = new Opt_Xml_Root();
     $buffer->addBefore(Opt_Xml_Buffer::TAG_BEFORE, 'foo');
     $buffer->addAfter(Opt_Xml_Buffer::TAG_BEFORE, 'bar');
     $buffer->addBefore(Opt_Xml_Buffer::TAG_BEFORE, 'joe');
     $property = new ReflectionProperty('Opt_Xml_Buffer', '_buffers');
     $property->setAccessible(true);
     $value = $property->getValue($buffer);
     if (is_array($value) && is_array($value[Opt_Xml_Buffer::TAG_BEFORE]) && $value[Opt_Xml_Buffer::TAG_BEFORE][0] == 'joe' && $value[Opt_Xml_Buffer::TAG_BEFORE][1] == 'foo' && $value[Opt_Xml_Buffer::TAG_BEFORE][2] == 'bar') {
         return true;
     }
     $this->fail('The values did not reach the code buffer in the correct order.');
 }