コード例 #1
0
 public function testToXmlWithTree()
 {
     $nestedset = new NestedSet_Model();
     $db = Zend_Db::factory('Pdo_Sqlite', array('dbname' => 'tests/test.db'));
     $nestedset->setDb($db);
     $nestedset->setTableName('nested');
     $nestedset->add('foo');
     $nestedset->add('bar', 1);
     $nestedset->add('foobar', 1);
     $tree = $nestedset->getElement(1);
     $xml = new DomDocument(1.0);
     $xml->load('tests/expected_result.xml');
     $this->assertEquals($nestedset->toXml($tree), $xml->saveXML());
 }