//$sSearch = "peter";
//$oTCH->RegisterMethodWithReturn("SearchUsers", array($sSearch));
//$sUser = "******";
//$oTCH->RegisterMethodWithReturn("GetUserInfo", array($sUser));
//$oTCH->RegisterMethodWithReturn("GetURL", array());
//$sUser = "******";
//$oTCH->RegisterMethodWithReturn("ShowWhoUserFollowing", array($sUser));
//$sUser = "******";
//$oTCH->RegisterMethodWithReturn("ShowWhoUserFollowers", array($sUser));
//$sUser = "******";
//$oTCH->RegisterMethodWithReturn("ShowWatchedRepos", array($sUser));
//$oTCH->RunTestMap();
echo "Number of API requests: " . CGithubAPICallLimitator::$_iCounter . "<br />";
echo "Elapsed time since first request: " . CGithubAPICallLimitator::$_iElapsedTime . "<br />";
// TEST CGithubUsers - POST
_printHTMLSubSectionHeader("POST Test");
$oTCH = new CTestClassHelper("CGithubUser", array($sResponseType, $bAuthenticate));
//$sSearch = "pete";
//$oTCH->RegisterMethodWithReturn("SearchUsers", array($sSearch));
//$sUser = "******";
//$oTCH->RegisterMethodWithReturn("GetUserInfo", array($sUser));
$sUser = "******";
//$sName = "Serafim Junior Dos Santos - Test";
$sName = "";
$sEmail = "";
$sBlog = "http://www.cyb3r.ca/test";
//$sCompany = "Serafim Junior Dos Santos Fagundes Cyb3r Web - Test";
$sCompany = "";
//$sLocation = "Montréal, Québec, Canada";
$sLocation = "";
$oTCH->RegisterMethodWithReturn("SetUserInfo", array($sUser, $sName, $sEmail, $sBlog, $sCompany, $sLocation));
//$iNumber = 8;
//$oTCH->RegisterMethodWithReturn("CloseIssue", array($sUser, $sRepo, $iNumber));
//$iNumber = 4;
//$oTCH->RegisterMethodWithReturn("ReOpenIssue", array($sUser, $sRepo, $iNumber));
//$oTCH->RegisterMethodWithReturn("ListLabels", array($sUser, $sRepo));
//$sLabel = "Label2";
//$iNumber = "2";
//$oTCH->RegisterMethodWithReturn("AddLabel", array($sUser, $sRepo, $sLabel, $iNumber));
//$sLabel = "Label1";
//$iNumber = "1";
//$oTCH->RegisterMethodWithReturn("RemoveLabel", array($sUser, $sRepo, $sLabel, $iNumber));
$oTCH->RunTestMap();
echo "Number of API requests: " . CGithubAPICallLimitator::$_iCounter . "<br />";
echo "Elapsed time since first request: " . CGithubAPICallLimitator::$_iElapsedTime . "<br />";
// TEST CGithubAPIRequester - POST
_printHTMLSubSectionHeader("GET Test");
$oTCH = new CTestClassHelper("CGithubIssues", array($sResponseType, $bAuthenticate));
//$sState = CGithubIssueStates::sClosed;
//$sSearchTerm = "opening";
//$oTCH->RegisterMethodWithReturn("SearchIssues", array($sUser, $sRepo, $sState, $sSearchTerm));
$sState = CGithubIssueStates::sOpen;
$oTCH->RegisterMethodWithReturn("ListIssues", array($sUser, $sRepo, $sState));
//$iNumber = 2;
//$oTCH->RegisterMethodWithReturn("ViewIssue", array($sUser, $sRepo, $iNumber));
//$iNumber = 5;
//$oTCH->RegisterMethodWithReturn("ListCommentsByIssue", array($sUser, $sRepo, $iNumber));
$sTitle = "Test open issue 100 Title";
$sBody = "Test open issue 100";
$oTCH->RegisterMethodWithReturn("OpenIssue", array($sUser, $sRepo, $sTitle, $sBody));
//$iNumber = 10;
//$oTCH->RegisterMethodWithReturn("CloseIssue", array($sUser, $sRepo, $iNumber));
Example #3
0
function _printTestClassMethodHeader($sTitle)
{
    _printHTMLSubSectionHeader($sTitle);
}