private function _testXmlParserTableHasDep() { $doc = simplexml_load_string($this->xml); $schema = $doc->schema; $table1 = array('schema' => $schema, 'table' => $schema->table[0]); $table2 = array('schema' => $schema, 'table' => $schema->table[1]); $this->assertTrue(xml_parser::table_has_dependency($table1, $table2)); }
public function testDependencyOfChild() { $parent = '<schema name="parentSchema" />'; $parent_table = ' <table name="parentTable"> </table>'; $child = '<schema name="childSchema" />'; $child_table = ' <table name="childTable" inheritsSchema="parentSchema" inheritsTable="parentTable"> </table>'; $parent_obj = array('schema' => simplexml_load_string($parent), 'table' => simplexml_load_string($parent_table)); $child_obj = array('schema' => simplexml_load_string($child), 'table' => simplexml_load_string($child_table)); $this->assertTrue(xml_parser::table_has_dependency($child_obj, $parent_obj)); $this->assertFalse(xml_parser::table_has_dependency($parent_obj, $child_obj)); }