public function testGetUpdatesSql() { Kwf_Registry::get('config')->server->updateTags = array('db'); $updates = Kwf_Util_Update_Helper::getUpdatesForDir('Kwf_Update_UpdateSql_Update'); $this->assertEquals(1, count($updates)); $this->assertEquals(100, $updates[0]->getLegacyRevision()); $this->assertEquals('foo bar;', $updates[0]->sql); }
public function testGetUpdatesSql3() { Kwf_Registry::get('config')->server->updateTags = array('kwf'); $updates = Kwf_Util_Update_Helper::getUpdatesForDir('Kwf_Update_Tags_Update'); $this->assertEquals(1, count($updates)); $this->assertEquals(101, $updates[0]->getLegacyRevision()); $this->assertEquals(array('kwf'), $updates[0]->getTags()); }
public function getUpdates() { if ($this->_factoryConfig['type'] == 'ClassName') { $id = $this->_factoryConfig['id']; if (strpos($id, '_') === false) { $classPrefix = 'Update_' . $id; } else { $classPrefix = substr($id, 0, strrpos($id, '_')) . '_Update_' . substr($id, strrpos($id, '_') + 1); } return Kwf_Util_Update_Helper::getUpdatesForDir($classPrefix); } else { return array(); } }