Re-order the events to ensure InitExtEvent() is fired off both with and without users.

This commit is contained in:
jgen 2014-02-22 01:22:14 -05:00
parent ba0aef4f30
commit e6057c656f
2 changed files with 8 additions and 3 deletions

View file

@ -600,7 +600,7 @@ $_execs = 0;
*/
function _count_execs($db, $sql, $inputarray) {
global $_execs;
if (defined(DEBUG_SQL) && (DEBUG_SQL === true || (is_null(DEBUG_SQL) && @$_GET['DEBUG_SQL']))) {
if ((defined(DEBUG_SQL) && DEBUG_SQL === true) || (!defined(DEBUG_SQL) && @$_GET['DEBUG_SQL'])) {
$fp = @fopen("data/sql.log", "a");
if($fp) {
if(isset($inputarray) && is_array($inputarray)) {

View file

@ -54,7 +54,12 @@ foreach(_get_themelet_files(get_theme()) as $themelet) {
_load_extensions();
// Put the database into autocommit mode. (We don't really need transactions for the test setup)
// Fire off the InitExtEvent()
$page = class_exists("CustomPage") ? new CustomPage() : new Page();
$user = _get_user();
send_event(new InitExtEvent());
// Put the database into autocommit mode for making the users.
$database->commit();
// Create the necessary users for the tests.
@ -62,7 +67,7 @@ $userPage = new UserPage();
$userPage->onUserCreation(new UserCreationEvent("demo", "demo", ""));
$userPage->onUserCreation(new UserCreationEvent("test", "test", ""));
// Fire off the InitExtEvent()
// Fire off the InitExtEvent() again after we have made the users.
$page = class_exists("CustomPage") ? new CustomPage() : new Page();
$user = _get_user();
send_event(new InitExtEvent());