Example #1
0
function getSameFile($src, $test, $path = '')
{
    $result = array();
    $as = listFile($src . $path);
    $ts = listFile($test . $path);
    $ds = array_intersect($as, $ts);
    foreach ($ds as $item) {
        $si = $src . $path . $item;
        $ti = $test . $path . $item;
        if (is_dir($si) && is_dir($ti)) {
            $result = array_merge($result, getSameFile($src, $test, $path . $item . '/'));
        } else {
            if (is_file($si) && is_file($ti)) {
                if (substr($si, -3) == '.js') {
                    array_push($result, $path . $item);
                }
            }
        }
    }
    return $result;
}
Example #2
0
 public static function listSrcOnly($print = true, $projroot = '../../../')
 {
     $srcpath = $projroot . 'src/';
     $testpath = $projroot . 'test/';
     require_once 'filehelper.php';
     $caselist = getSameFile($srcpath, $testpath, '');
     $srclist = getSrcOnlyFile($srcpath, $testpath, '');
     $srcList = array();
     foreach ($srclist as $case) {
         if (in_array($case, $caselist)) {
             continue;
         }
         $name = str_replace('/', '.', substr($case, 0, -3));
         $tag = "<a class=\"jsframe_qunit\" title=\"{$name}\">" . (strlen($name) > 20 ? substr($name, 6) : $name) . "</a>";
         array_push($srcList, $tag);
         if ($print) {
             echo $tag;
         }
     }
     return $srcList;
 }
Example #3
0
 public static function listSrcOnly($print = true)
 {
     $srcpath = Config::$projroot . Config::$src_PATH;
     $testpath = Config::$projroot . Config::$test_PATH;
     require_once 'fileHelper.php';
     $caselist = getSameFile($srcpath, $testpath, '');
     $srclist = getSrcOnlyFile($srcpath, $testpath, '');
     $srcList = array();
     foreach ($srclist as $case) {
         if (in_array($case, $caselist)) {
             continue;
         }
         $name = str_replace('/', '.', substr($case, 0, -3));
         $tag = "<a  title=\"{$name}\">" . (strlen($name) > 20 ? substr($name, 6) : $name) . "</a>";
         array_push($srcList, $tag);
         if ($print) {
             echo $tag;
         }
     }
     return $srcList;
 }