芝麻web文件管理V1.00
编辑当前文件:/home/strato/chroot/opt/RZphp5/includes/test/PEAR_Info/tests/render.phpt
--TEST-- PEAR_Info using render options --FILE-- set('php_dir', $peardir); $config->writeConfigFile($conf_file); // also writes custom pear system config files $config->writeConfigFile($custom_file1); $config->writeConfigFile($custom_file2); } /** * TestCase 1: * usage of stylesheet to customize look and feel */ $testCase = 'testCustomStyleSheet'; $GLOBALS['_PEAR_Config_instance'] = null; $pearInfo = new PEAR_Info($peardir); $css_exists = $pearInfo->setStyleSheet($tpldir . $ds . 'blueskin.css'); $result = ($css_exists) ? 'OK' : 'CSS file does not exists'; echo $testCase . ' : ' . $result; echo "\n"; /** * TestCase 2: * display main page with default stylesheet */ $testCase = 'testDefaultStyleSheet'; $GLOBALS['_PEAR_Config_instance'] = null; $options = array('resume' => PEAR_INFO_GENERAL | PEAR_INFO_PACKAGES_VERSION | PEAR_INFO_FULLPAGE, 'channels' => array()); $pearInfo = new PEAR_Info($peardir, '', '', $options); $html = $pearInfo->toHtml(); $packages_tpl = file_get_contents($tpldir . $ds . 'packages.tpl'); $packages_tpl = str_replace( array( '{styles}', '{script_filename}', '{config_file}', '{usr_config_file}', '{sys_config_file}' ), array( $pearInfo->getStyleSheet(), __FILE__, $conf_file, $u_conf_file, $conf_file ), $packages_tpl); if (OS_WINDOWS) { $html = str_replace("\r\n", "\n", $html); } $result = (strcasecmp($html, $packages_tpl) == 0) ? 'OK' : 'HTML strings are not same'; echo $testCase . ' : ' . $result; echo "\n"; /** * TestCase 3: * display credits page with default stylesheet */ $testCase = 'testCreditsWithDefaultStyleSheet'; $GLOBALS['_PEAR_Config_instance'] = null; $options = array('resume' => PEAR_INFO_GENERAL | PEAR_INFO_CREDITS_ALL | PEAR_INFO_FULLPAGE, 'channels' => array()); $pearInfo = new PEAR_Info($peardir, '', '', $options); ob_start(); $pearInfo->show(); $html = ob_get_contents(); ob_end_clean(); $credits_tpl = file_get_contents($tpldir . $ds . 'credits.tpl'); $credits_tpl = str_replace( array( '{styles}', '{script_filename}', '{config_file}', '{usr_config_file}', '{sys_config_file}' ), array( $pearInfo->getStyleSheet(), __FILE__, $conf_file, $u_conf_file, $conf_file ), $credits_tpl); if (OS_WINDOWS) { $html = str_replace("\r\n", "\n", $html); } $result = (strcasecmp($html, $credits_tpl) == 0) ? 'OK' : 'HTML strings are not same'; echo $testCase . ' : ' . $result; ?> --CLEAN-- --EXPECT-- testCustomStyleSheet : OK testDefaultStyleSheet : OK testCreditsWithDefaultStyleSheet : OK