define_core_constants(); // Define YOURLS actions upon new instance $init = new \YOURLS\Config\InitDefaults; $init->check_maintenance_mode = false; $init->fix_request_uri = false; $init->redirect_ssl = false; $init->redirect_to_install = false; $init->check_if_upgrade_needed = false; $init->load_plugins = false; // do not attempt to load (no DB yet to store data), but do send the 'plugins_loaded' action (some code depend on it) $init->get_all_options = false; $init->check_new_version = false; new \YOURLS\Config\Init($init); // All set -- install yut_install_yourls(); // All set -- instantiate the rest yourls_get_all_options(); yourls_load_plugins(); // At this point, tests will start // Simplify yourls_die() when running unit tests yourls_add_action( 'pre_yourls_die', function($params) { printf("\n\nCalling yourls_die(). %s : %s (%s)\n\n", $params[1], $params[0], $params[2]); echo "Last 10 Backtrace:\n"; $trace = debug_backtrace(); foreach( array_slice($trace, 0, 10) as $t ) { printf("** %s:%d %s() with args\n%s\n", $t['file'], $t['line'], $t['function'], var_export($t['args'], true)); } die(1); } ); echo "YOURLS installed, starting PHPUnit\n\n"; require_once __DIR__ . "/tests/auth/AbstractLoginTestCase.php"; require_once __DIR__ . "/tests/auth/LoginAssertionTrait.php";