function testNoMissingParams()
 {
     global $ATTACHED_MESSAGES, $ATTACHED_MESSAGES_RAW;
     $lists = find_all_previews__by_screen();
     foreach ($lists as $function => $tpls) {
         $template = $tpls[0];
         $hook = NULL;
         if (is_file(get_file_base() . '/_tests/screens_tested/nonemissing__' . $function)) {
             continue;
         }
         // To make easier to debug through
         if (function_exists('set_time_limit')) {
             @set_time_limit(0);
         }
         $ATTACHED_MESSAGES = new ocp_tempcode();
         $ATTACHED_MESSAGES_RAW = array();
         $out1 = render_screen_preview($template, $hook, $function);
         $put_out = !$ATTACHED_MESSAGES->is_empty() || count($ATTACHED_MESSAGES_RAW) > 0;
         $this->assertFalse($put_out, 'Messages put out by ' . $function . '  (' . strip_tags($ATTACHED_MESSAGES->evaluate()) . ')');
         if (!$put_out) {
             fclose(fopen(get_file_base() . '/_tests/screens_tested/nonemissing__' . $function, 'wb'));
             sync_file(get_file_base() . '/_tests/screens_tested/nonemissing__' . $function);
             fix_permissions(get_file_base() . '/_tests/screens_tested/nonemissing__' . $function);
         }
         unset($out1);
     }
 }
Beispiel #2
0
 /**
  * Shows the preview of a screen
  *
  * @return tempcode		The UI
  */
 function view_screen_preview()
 {
     $GLOBALS['HELPER_PANEL_PIC'] = '';
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = '';
     $GLOBALS['SCREEN_TEMPLATE_CALLED'] = '';
     require_code('lorem');
     global $LOREM_AVOID_GLOBALISE;
     $LOREM_AVOID_GLOBALISE = true;
     $template = get_param('id');
     $hook = get_param('hook');
     $function = get_param('function');
     //get_page_title('SCREEN_PREVIEW',true,array(escape_html($function))); // Affects breadcrumbs etc
     get_page_title($function, false);
     // Affects breadcrumbs etc
     breadcrumb_set_parents(array(array('_SELF:_SELF:list', do_lang_tempcode('SCREEN_PREVIEWS'))));
     return render_screen_preview($template, $hook, $function);
 }