Пример #1
0
<?php

$DbId = "Test_gettextcontent";
CreateTestApiCall("http://localhost:8000/Db/{$DbId}", "POST", "", "inResponse", "theRealStatus", $theTest, "var theRealStatus = 0;\n                    if (inResponse.data == \"Ok\")\n                    {\n                       " . GetJSForSendSynchroRequest("/Db/{$DbId}/DocMgr/New/myTitle/2", "POST", "") . "\n                       " . GetJSForSendSynchroRequest("/Db/{$DbId}/DocMgr/List/1/TextContent", "POST", "Content=TextContent") . "\n                       " . GetJSResultForSendSynchroRequest("/Db/{$DbId}/DocMgr/List/1/TextContent", "GET", "", "lDump", "Error: connection failed") . "\n                       lExpectedResult = \"[[\\\"TextContent\\\"]]\";\n                       //console.log(\"Dump ! (dump: .\"+lDump+\". vs .\"+lExpectedResult+\".\");\n                       theRealStatus = (lDump === lExpectedResult);\n                       //console.log(\"theRealStatus:\"+theRealStatus);\n                       inResponse.data = \"Failed to match reference: \"+lDump+\" VS expected: \"+lExpectedResult;\n                    }\n                    else\n                    {\n                       //console.log(\"no dump: .\"+inResponse.data+\".\");\n                    }\n");
Пример #2
0
<?php

$DbId = "Test_createdb";
CreateTestApiCall("http://localhost:8000/Db/{$DbId}", "POST", "", "inResponse", "theRealStatus", $theTest, "var theRealStatus = 0;\n                    if (inResponse.data == \"Ok\")\n                    {\n                       " . GetJSForSendSynchroRequest("/Db/{$DbId}/UserMgr/New/myName/myLogin/myPassword", "POST", "") . "\n                       " . GetJSForSendSynchroRequest("/Db/{$DbId}/DocMgr/New/myTitle/2", "POST", "") . "\n                       " . GetJSForDumpingDbContent($DbId, "lDump") . "\n                       lExpectedResult = \"#Dump of Users:[[\\\"1\\\",\\\"myName\\\",\\\"myLogin\\\",\\\"myPassword\\\",\\\"\\\",\\\"0\\\"]]#Dump of Docs:[[\\\"1\\\",\\\"myTitle\\\",\\\"1\\\",\\\"2\\\",null,null]]#Dump of Links:[]\";\n                       //console.log(\"Dump ! (dump: .\"+lDump+\". vs .\"+lExpectedResult+\".\");\n                       theRealStatus = (lDump === lExpectedResult);\n                       //console.log(\"theRealStatus:\"+theRealStatus);\n                       inResponse.data = \"Failed to match reference: \"+lDump+\" VS expected: \"+lExpectedResult;\n                    }\n                    else\n                    {\n                       //console.log(\"no dump: .\"+inResponse.data+\".\");\n                    }\n");
Пример #3
0
function GetJSResultForSendSynchroRequest($inPath, $inVerb, $inAddedData, $outResultVarName, $inErrorValue)
{
    return GetJSForSendSynchroRequest($inPath, $inVerb, $inAddedData) . "{$outResultVarName} = \"" . $inErrorValue . "\";\n         console.log(lRequest.status);\n         if (lRequest.status === 200) {\n           console.log(lRequest.responseText);\n           {$outResultVarName} = lRequest.responseText;\n         }";
}