18
18
limitations under the License.
19
19
=========================================================================*/
20
20
21
+ /** Get database types */
21
22
function getSqlDbTypes ($ testConfigDir )
22
23
{
23
24
// setup testing for whichever db config testing files exist
@@ -38,6 +39,7 @@ function getSqlDbTypes($testConfigDir)
38
39
return $ dbTypes ;
39
40
}
40
41
42
+ /** Load database adapter */
41
43
function loadDbAdapter ($ testConfigDir , $ dbType )
42
44
{
43
45
// create the lockfile for this dbType
@@ -63,7 +65,7 @@ function loadDbAdapter($testConfigDir, $dbType)
63
65
'username ' => $ configDatabase ->database ->params ->username ,
64
66
'password ' => $ configDatabase ->database ->params ->password ,
65
67
'dbname ' => $ configDatabase ->database ->params ->dbname ,
66
- 'port ' =>$ configDatabase ->database ->params ->port , ));
68
+ 'port ' => $ configDatabase ->database ->params ->port ));
67
69
if ($ configDatabase ->database ->profiler == '1 ' )
68
70
{
69
71
$ db ->getProfiler ()->setEnabled (true );
@@ -79,6 +81,7 @@ function loadDbAdapter($testConfigDir, $dbType)
79
81
}
80
82
}
81
83
84
+ /** Drop database tables */
82
85
function dropTables ($ db , $ dbType )
83
86
{
84
87
$ tables = $ db ->listTables ();
@@ -96,10 +99,11 @@ function dropTables($db, $dbType)
96
99
}
97
100
}
98
101
102
+ /** Install and upgrade core */
99
103
function installCore ($ db , $ dbType , $ utilityComponent )
100
104
{
101
105
require_once BASE_PATH .'/core/controllers/components/UpgradeComponent.php ' ;
102
- $ upgradeComponent= new UpgradeComponent ();
106
+ $ upgradeComponent = new UpgradeComponent ();
103
107
$ upgradeComponent ->dir = BASE_PATH .'/core/database/ ' .$ dbType ;
104
108
$ upgradeComponent ->init = true ;
105
109
@@ -131,7 +135,7 @@ function installCore($db, $dbType, $utilityComponent)
131
135
$ upgradeComponent ->upgrade (str_replace ('.sql ' , '' , basename ($ sqlFile )), true /* true for testing */ );
132
136
}
133
137
134
- // want to create a default assetstore that is separate from application's
138
+ /** Create default assetstore */
135
139
function createDefaultAssetstore ()
136
140
{
137
141
Zend_Registry::set ('models ' , array ());
@@ -164,25 +168,24 @@ function createDefaultAssetstore()
164
168
$ assetstore ->save ($ assetstoreDao );
165
169
}
166
170
167
- // install and perform upgrades on modules
168
- //
169
- // What to do about module config files, these should be copied into
170
- // core/configs when a module is installed, but we can't do that
171
- // as there are already module files there, and we may not want
172
- // all the module files
173
- // we could copy the existing ones somewhere, then copy them back at the end
174
- // but I don't like that idea
175
- // for now do nothing
171
+ /** Install and upgrade modules */
176
172
function installModules ($ utilityComponent )
177
173
{
174
+ // What to do about module config files, these should be copied into
175
+ // core/configs when a module is installed, but we can't do that
176
+ // as there are already module files there, and we may not want
177
+ // all the module files
178
+ // we could copy the existing ones somewhere, then copy them back at the end
179
+ // but I don't like that idea
180
+ // for now do nothing
178
181
$ modules = $ utilityComponent ->getAllModules ();
179
182
foreach ($ modules as $ moduleName => $ module )
180
183
{
181
184
$ utilityComponent ->installModule ($ moduleName );
182
185
}
183
186
}
184
187
185
- // cleanup the lock file
188
+ /** Release lock file */
186
189
function releaseLock ($ dbType )
187
190
{
188
191
if (file_exists (BASE_PATH .'/tests/configs/lock. ' .$ dbType .'.ini ' ))
0 commit comments