コード例 #1
0
 private function common_structure($old, $new)
 {
     dbsteward::$old_database = new SimpleXMLElement($old);
     dbsteward::$new_database = new SimpleXMLElement($new);
     mysql5_diff::$new_table_dependency = xml_parser::table_dependency_order(dbsteward::$new_database);
     $ofs1 = new mock_output_file_segmenter();
     $ofs3 = new mock_output_file_segmenter();
     mysql5_diff::revoke_permissions($ofs1, $ofs3);
     mysql5_diff::update_structure($ofs1, $ofs3);
     mysql5_diff::update_permissions($ofs1, $ofs3);
     // @TODO: assert expected = actual
     // echo "\n\nofs 1:\n\n";
     // echo $ofs1->_get_output();
     // echo "\n\nofs 3:\n\n";
     // echo $ofs3->_get_output();
 }
コード例 #2
0
 private function diff($old, $new, $expected1, $expected3, $message = '')
 {
     dbsteward::$old_database = xml_parser::composite_doc(NULL, simplexml_load_string($this->db_doc_xml . $old . '</dbsteward>'));
     dbsteward::$new_database = xml_parser::composite_doc(NULL, simplexml_load_string($this->db_doc_xml . $new . '</dbsteward>'));
     $ofs1 = new mock_output_file_segmenter();
     $ofs3 = new mock_output_file_segmenter();
     mysql5_diff::$old_table_dependency = xml_parser::table_dependency_order(dbsteward::$old_database);
     mysql5_diff::$new_table_dependency = xml_parser::table_dependency_order(dbsteward::$new_database);
     mysql5_diff::update_structure($ofs1, $ofs3);
     $actual1 = trim($ofs1->_get_output());
     $actual3 = trim($ofs3->_get_output());
     $this->assertEquals($expected1, $actual1, "during stage 1: {$message}");
     $this->assertEquals($expected3, $actual3, "during stage 3: {$message}");
 }