예제 #1
0
 /**
  * Displays the content of the test directory.
  *
  * @return void
  */
 public function draw_test_dir()
 {
     $ecr_project = JFactory::getApplication()->input->get('ecr_project');
     $this->testsBase = 'administrator' . DS . 'components' . DS . $ecr_project . DS . 'tests';
     $timeStamp = date('Ymd_his');
     $jsFile = '';
     $jsFile .= " onclick=\"doPHPUnit('[link]', '[file]', '{$timeStamp}', '[id]');\"";
     $jsFolder = '';
     $fileTree = new EcrFileTree(JPATH_ROOT . DS . $this->testsBase, '', $jsFile, $jsFolder);
     $arguments = array();
     $response = array();
     //-- Joomla! bootstrap
     $arguments[] = '--bootstrap ' . JPATH_ROOT . DS . 'bootstrap.php';
     // @codingStandardsIgnoreStart - use of superglobals
     $results = print_r($_REQUEST, true);
     // @codingStandardsIgnoreEnd
     $response['text'] = $fileTree->drawFullTree();
     $response['console'] = htmlentities($results);
     $response['status'] = 1;
     echo json_encode($response);
     jexit();
 }
예제 #2
0
 /**
  * Get extended Information for an extension temlate.
  *
  * AJAX called. !
  *
  * @return void
  */
 public function ajGetExtensionTemplateInfo()
 {
     $input = JFactory::getApplication()->input;
     $jsFile = '';
     $fileTree = new EcrFileTree('', '', $jsFile, '');
     $extType = $input->get('extType');
     $folder = $input->get('folder');
     $response = array();
     $response['status'] = 0;
     $response['text'] = '';
     if (!$extType || !$folder) {
         $response['text'] = 'Invalid options';
         echo json_encode($response);
         return;
     }
     $dir = ECRPATH_EXTENSIONTEMPLATES . DS . $extType . DS . $folder;
     $folders = JFolder::folders($dir, '.', false, true, array('.svn'));
     foreach ($folders as $folder) {
         $fileTree->setDir($folder);
         $response['text'] .= $fileTree->drawFullTree();
     }
     //foreach
     $response['status'] = 1;
     echo json_encode($response);
 }
예제 #3
0
    <strong><?php 
echo jgettext('Tests');
?>
</strong>
    <div class="ecrBigInfo">
	    <?php 
echo jgettext('Click a to execute a UnitTest.');
?>
    </div>
    <div class="file_tree_path"><?php 
echo str_replace(DS, '&nbsp;' . DS . '&nbsp;', $this->testsBase);
?>
</div>
    <div id="test_tree">
        <?php 
echo $fileTree->drawFullTree();
?>
    </div>
</div>

<div class="ecr_floatbox">
    <strong><?php 
echo jgettext('Options');
?>
</strong>
    <br />
    <input type="checkbox" checked="checked" id="show_result" />
    <label for="show_result"><?php 
echo jgettext('Show results');
?>
</label>