public function testDowngrades() { $front = $this->getFrontController(); $modulePath = $front->getModuleDirectory('faqs'); $schemaManager = new Capacitor_Db_Schema_Manager($modulePath . '/schemas', $this->_application->getBootstrap()->getResource('db'), 'faqs'); $result = $schemaManager->downTo(0, false); $this->assertContains($result, array(Capacitor_Db_Schema_Manager::RESULT_OK, Capacitor_Db_Schema_Manager::RESULT_AT_CURRENT_VERSION)); }
/** * This module will install the schema needed for the specified module. * @param String $module */ protected function _installModule($module) { $front = $this->getFrontController(); $modulePath = $front->getModuleDirectory($module); $schemaManager = new Capacitor_Db_Schema_Manager($modulePath . '/schemas', $this->_application->getBootstrap()->getResource('db'), $module); $result = $schemaManager->updateTo(); if (!in_array($result, array(Capacitor_Db_Schema_Manager::RESULT_OK, Capacitor_Db_Schema_Manager::RESULT_AT_CURRENT_VERSION))) { throw new Capacitor_Exception('There was an issue while installing the ' . $module . ' module.(' . $result . ')'); } }