/**
  * @covers ::globalFunction ( )
  */
 public function testSomething()
 {
     globalFunction();
 }
コード例 #2
0
function createJSONObject()
{
    global $functionList;
    global $classList;
    global $globalVariable;
    global $node_id;
    global $node_x;
    global $node_y;
    $jsonObj = '{';
    if (sizeof($classList) > 0) {
        $jsonObj .= createClassCompositionView($jsonObj);
    }
    if (sizeof($globalVariable) > 0) {
        $jsonObj .= globalVariableView($jsonObj);
    }
    if (sizeof($functionList) > 0) {
        $jsonObj .= globalFunction($jsonObj);
    }
    $jsonObj .= inheritanceView($jsonObj);
    //before closing main json object add json array containing all .js file path
    $fileJsonObj = storeJsFiles();
    $jsonObj .= $fileJsonObj;
    //closing main json object
    $jsonObj .= '}';
    //save json object to file
    $file = fopen("../files/" . $_POST["jsonName"] . ".json", "w") or die("error");
    fwrite($file, $jsonObj);
    fclose($file);
    //echo "saved";
    //redirect to same page
    $mssg = $_POST["jsonName"] . ' project has been saved';
    header('Location: /jsvisualizer?mssg=' . $mssg);
}