Example #1
0
 public function testMigrateClearsErrors()
 {
     $migration = new Doctrine_Migration('migration_classes');
     $migration->setCurrentVersion(3);
     try {
         $migration->migrate(3);
     } catch (Doctrine_Migration_Exception $e) {
         $this->assertTrue($migration->hasErrors());
         $this->assertEqual(1, $migration->getNumErrors());
     }
     try {
         $migration->migrate(3);
     } catch (Doctrine_Migration_Exception $e) {
         $this->assertTrue($migration->hasErrors());
         $this->assertEqual(1, $migration->getNumErrors());
     }
     $migration->clearErrors();
     $this->assertFalse($migration->hasErrors());
     $this->assertEqual(0, $migration->getNumErrors());
 }