// Skip blank lines to avoid testing nothing $this->is(trim($array_exp1[$i]), trim($array_exp2[$i]), sprintf('Line %d matches %s', $i, $array_exp1[$i])); } } } require_once SF_DIR . 'test/bootstrap/unit.php'; require_once dirname(__FILE__) . '/../../lib/addon/sfPropelDatabaseSchema.class.php'; require_once SF_DIR . 'lib/util/sfInflector.class.php'; require_once SF_DIR . 'lib/util/sfToolkit.class.php'; require_once SF_DIR . 'lib/yaml/sfYaml.php'; $t = new my_lime_test(409); $t->diag('Classical YAML to XML conversion'); $p = new sfPropelDatabaseSchema(); $p->loadYAML(dirname(__FILE__) . '/fixtures/schema.yml'); $target = file_get_contents(dirname(__FILE__) . '/fixtures/schema.xml'); $t->is_line_by_line($p->asXML(), $target); $t->diag('New YAML to XML conversion'); $p = new sfPropelDatabaseSchema(); $p->loadYAML(dirname(__FILE__) . '/fixtures/new_schema.yml'); $target = file_get_contents(dirname(__FILE__) . '/fixtures/schema.xml'); $t->is_line_by_line($p->asXML(), $target); $t->diag('New YAML to Old YAML conversion'); $old_yml_target = sfYaml::load(dirname(__FILE__) . '/fixtures/schema.yml'); $p = new sfPropelDatabaseSchema(); $new_yml_transformed = $p->convertNewToOldYaml(sfYaml::load(dirname(__FILE__) . '/fixtures/new_schema.yml')); $t->is_array_explicit($new_yml_transformed, $old_yml_target); $t->diag('Old YAML to New YAML conversion'); $new_yml_target = sfYaml::load(dirname(__FILE__) . '/fixtures/new_schema.yml'); $p = new sfPropelDatabaseSchema(); $old_yml_transformed = $p->convertOldToNewYaml(sfYaml::load(dirname(__FILE__) . '/fixtures/schema.yml')); $t->is_array_explicit($old_yml_transformed, $new_yml_target);