Beispiel #1
0
 public function testScannableInsertBefore2()
 {
     $topNode = new Opt_Xml_Element('foo');
     $subnodes = array(0 => new Opt_Xml_Element('bar'), new Opt_Xml_Element('joe'), new Opt_Xml_Element('goo'));
     $topNode->appendChild($subnodes[0]);
     $topNode->appendChild($subnodes[1]);
     $topNode->insertBefore($subnodes[2]);
     $ok = true;
     $i = 0;
     foreach ($topNode as $n) {
         if ($n !== $subnodes[$i]) {
             $ok = false;
         }
         $i++;
     }
     $this->assertTrue($ok);
 }