$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); $t->todo('XML and classical YAML internal representation'); $p1 = new sfPropelDatabaseSchema(); $p1->loadXML(dirname(__FILE__) . '/fixtures/schema.xml'); $p2 = new sfPropelDatabaseSchema(); $p2->loadYAML(dirname(__FILE__) . '/fixtures/schema.yml'); //$t->is_array_explicit($p1->asArray(), $p2->asArray()); $t->todo('XML and classical YAML compared as XML'); //$t->is_line_by_line($p1->asXML(), $p2->asXML()); $t->todo('XML and classical YAML compared as YAML'); //$t->is_line_by_line($p1->asYAML(), $p2->asYAML());
} class my_lime_test extends lime_test { function diag($message, $adapter = '') { if ($adapter) { $adapter = " [{$adapter}]"; } $this->output->diag($message . $adapter); } } $t = new my_lime_test($tests_generic, new lime_output_color()); $t->diag('*** Generic Tests ***'); $t->diag('initialization', $adapter); foreach ($adapters as $adapter) { $t->todo('loadFile() throws an exception when an invalid file is loaded'); // todo: remove annoying error that results when uncommenting below code // try // { // $thmb = new sfThumbnail(150, 150, true, true, 75, $adapter, array()); // $thmb->loadFile($invalid); // $t->fail('loadFile() throws an exception when an invalid file is loaded'); // } // catch (Exception $e) // { // $t->pass('loadFile() throws an exception when an invalid file is loaded'); // } // default options $t->diag('creates standard thumbnail', $adapter); $thmb = new sfThumbnail(150, 150, true, true, 75, $adapter, array()); $thmb->loadFile($data['image/jpeg']);