function test_cachePreferenceOptions()
 {
     $oExtension = new OX_Extension_Common();
     $GLOBALS['_MAX']['CONF']['pluginPaths']['packages'] = '/lib/OX/Extension/tests/data/';
     $GLOBALS['_MAX']['CONF']['pluginGroupComponents'] = array('testPlugin' => 1);
     $this->_backupCacheFile('PrefOptions_Plugins');
     $oExtension->cachePreferenceOptions();
     $oCache = new OA_Cache('Plugins', 'PrefOptions');
     $oCache->setFileNameProtection(false);
     $aPrefOptions = $oCache->load(true);
     $this->assertIsA($aPrefOptions, 'array');
     $this->assertEqual(count($aPrefOptions), 1);
     $this->assertTrue(isset($aPrefOptions['testPlugin']));
     $this->assertTrue(isset($aPrefOptions['testPlugin']['value']));
     $this->assertTrue(isset($aPrefOptions['testPlugin']['name']));
     $this->assertTrue(isset($aPrefOptions['testPlugin']['perm']));
     $this->assertEqual($aPrefOptions['testPlugin']['name'], 'testPlugin');
     $this->assertEqual($aPrefOptions['testPlugin']['text'], 'Option Text');
     $this->assertEqual($aPrefOptions['testPlugin']['value'], 'account-preferences-plugin.php?group=testPlugin');
     $this->assertEqual(count($aPrefOptions['testPlugin']['perm']), 4);
     $this->_restoreCacheFile('PrefOptions_Plugins');
     TestEnv::restoreConfig();
 }
     if ($fp = fopen(MAX_PATH . '/var/plugins-report.log', 'w')) {
         fwrite($fp, "********** Display array var_dump **********\n");
         fwrite($fp, print_r($aPlugins['simple'], true));
         fwrite($fp, "\n********** Errors array var_dump: **********\n");
         fwrite($fp, print_r($aPlugins['errors'], true));
         fwrite($fp, "\n********** getPluginsDiagnostics() var_dump: **********\n");
         fwrite($fp, print_r($aPlugins['detail'], true));
         fclose($fp);
     }
     break;
 case 'pref':
     // this rebuilds the cached array that holds the text and links
     // for the account-preferences drop-down list
     require_once LIB_PATH . '/Extension/ExtensionCommon.php';
     $oExtensionManager = new OX_Extension_Common();
     $oExtensionManager->cachePreferenceOptions();
     break;
 case 'hook':
     // this rebuilds the cached array that holds the component hook registration array
     require_once LIB_PATH . '/Extension/ExtensionCommon.php';
     $oExtensionManager = new OX_Extension_Common();
     $oExtensionManager->cacheComponentHooks();
     break;
 case 'reg':
     // currently rewrites delivery hooks to conf
     require_once LIB_PATH . '/Extension/ExtensionDelivery.php';
     $oExtensionManager = new OX_Extension_Delivery();
     $oExtensionManager->runTasksOnDemand();
     break;
 case 'exp':
     $oTpl = new OA_Admin_Template('plugin-export.html');