. */ /** * Doctrine_Migration_TestCase * * @package Doctrine * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping * @link www.phpdoctrine.com * @since 1.0 * @version $Revision$ */ class Doctrine_Migration_TestCase extends Doctrine_UnitTestCase { public function testMigration() { // New migration for the 'migration_classes' directory $migration = new Doctrine_Migration('migration_classes'); // migrate to version 3 $migration->migrate(2); // Make sure the column was added $this->assertTrue(Doctrine_Manager::getInstance()->getTable('User')->hasColumn('field2')); // now migrate back to original version $migration->migrate(0); // Make sure the current version is 0 $this->assertEqual($migration->getCurrentVersion(), 0); } }