/** * Run shutdown routine * * Recommended to call this when you don't want the Moodlerooms * Framework to conflict with other code, EG: when using the * framework on the cron. * * @return void */ public static function shutdown() { if (self::$init) { // Stop autoloading all mr_* classes mr_autoload::unregister(); // Reset! self::$init = false; } }
public function test_unregister() { mr_autoload::register(); mr_autoload::unregister(); $autoloads = spl_autoload_functions(); $this->assertIsA($autoloads, 'array'); $found = false; foreach ($autoloads as $autoload) { if (is_array($autoload) and $autoload[0] instanceof mr_autoload) { $found = true; } } $this->assertFalse($found); }