@@ -27,6 +27,35 @@ abstract class UnishTestCase extends TestCase
27
27
28
28
private static $ backendOutputDelimiter = 'DRUSH_BACKEND_OUTPUT_START>>>%s<<<DRUSH_BACKEND_OUTPUT_END ' ;
29
29
30
+ public function __construct ($ name = null , array $ data = [], $ dataName = '' )
31
+ {
32
+ parent ::__construct ($ name , $ data , $ dataName );
33
+
34
+ // We read from env then globals then default to mysql.
35
+ self ::$ db_url = getenv ('UNISH_DB_URL ' ) ?: (isset ($ GLOBALS ['UNISH_DB_URL ' ]) ? $ GLOBALS ['UNISH_DB_URL ' ] : 'mysql://root:@127.0.0.1 ' );
36
+
37
+ // require_once __DIR__ . '/unish.inc';
38
+ // list($unish_tmp, $unish_sandbox, $unish_drush_dir) = \unishGetPaths();
39
+ $ unish_sandbox = Path::join (dirname (__DIR__ ), 'sandbox ' );
40
+ self ::mkdir ($ unish_sandbox );
41
+ $ unish_cache = Path::join ($ unish_sandbox , 'cache ' );
42
+
43
+ self ::$ drush = self ::getComposerRoot () . '/drush ' ;
44
+
45
+ self ::$ sandbox = $ unish_sandbox ;
46
+ self ::$ usergroup = isset ($ GLOBALS ['UNISH_USERGROUP ' ]) ? $ GLOBALS ['UNISH_USERGROUP ' ] : null ;
47
+
48
+ self ::setEnv (['CACHE_PREFIX ' => $ unish_cache ]);
49
+ $ home = $ unish_sandbox . '/home ' ;
50
+ self ::setEnv (['HOME ' => $ home ]);
51
+ self ::setEnv (['HOMEDRIVE ' => $ home ]);
52
+ $ composer_home = $ unish_cache . '/.composer ' ;
53
+ self ::setEnv (['COMPOSER_HOME ' => $ composer_home ]);
54
+ self ::setEnv (['ETC_PREFIX ' => $ unish_sandbox ]);
55
+ self ::setEnv (['SHARE_PREFIX ' => $ unish_sandbox ]);
56
+ self ::setEnv (['TEMP ' => Path::join ($ unish_sandbox , 'tmp ' )]);
57
+ }
58
+
30
59
/**
31
60
* @return array
32
61
*/
@@ -135,35 +164,6 @@ public static function getBackendOutputDelimiter()
135
164
return self ::$ backendOutputDelimiter ;
136
165
}
137
166
138
- public function __construct ($ name = null , array $ data = [], $ dataName = '' )
139
- {
140
- parent ::__construct ($ name , $ data , $ dataName );
141
-
142
- // We read from env then globals then default to mysql.
143
- self ::$ db_url = getenv ('UNISH_DB_URL ' ) ?: (isset ($ GLOBALS ['UNISH_DB_URL ' ]) ? $ GLOBALS ['UNISH_DB_URL ' ] : 'mysql://root:@127.0.0.1 ' );
144
-
145
- // require_once __DIR__ . '/unish.inc';
146
- // list($unish_tmp, $unish_sandbox, $unish_drush_dir) = \unishGetPaths();
147
- $ unish_sandbox = Path::join (dirname (__DIR__ ), 'sandbox ' );
148
- self ::mkdir ($ unish_sandbox );
149
- $ unish_cache = Path::join ($ unish_sandbox , 'cache ' );
150
-
151
- self ::$ drush = self ::getComposerRoot () . '/drush ' ;
152
-
153
- self ::$ sandbox = $ unish_sandbox ;
154
- self ::$ usergroup = isset ($ GLOBALS ['UNISH_USERGROUP ' ]) ? $ GLOBALS ['UNISH_USERGROUP ' ] : null ;
155
-
156
- self ::setEnv (['CACHE_PREFIX ' => $ unish_cache ]);
157
- $ home = $ unish_sandbox . '/home ' ;
158
- self ::setEnv (['HOME ' => $ home ]);
159
- self ::setEnv (['HOMEDRIVE ' => $ home ]);
160
- $ composer_home = $ unish_cache . '/.composer ' ;
161
- self ::setEnv (['COMPOSER_HOME ' => $ composer_home ]);
162
- self ::setEnv (['ETC_PREFIX ' => $ unish_sandbox ]);
163
- self ::setEnv (['SHARE_PREFIX ' => $ unish_sandbox ]);
164
- self ::setEnv (['TEMP ' => Path::join ($ unish_sandbox , 'tmp ' )]);
165
- }
166
-
167
167
/**
168
168
* We used to assure that each class starts with an empty sandbox directory and
169
169
* a clean environment except for the SUT. History: http://drupal.org/node/1103568.
0 commit comments