public function testWithGoodJson()
 {
     include_once dirname(__FILE__) . "/../../ServiceWrapper.php";
     $uri = "http://local.swiftcore.com/ServiceAPI/RegisterNewProcessingJob.php";
     $service = new ServiceWrapper($uri);
     $json = $service->MakePOSTRequest(array("key" => "testkey", "data" => '[{"type":"Test","updatePeriod":"5","parameters":[{"test":"test"}]}]'), 10);
     $this->assertEquals(true, strpos($json, "error") == false);
 }
Example #2
0
 /**
  *
  *   //get all the admin feeds in database.
  */
 private function get_new_feeds($category_id)
 {
     //Use the service wrapper to make an async call to get an parser any new content
     $service = new ServiceWrapper($this->API_URL . "RunNextProcessingJob.php");
     $service->MakeAsyncPostRequest(array("key" => "test"));
 }
            $json = $service->MakePOSTRequest(array("key" => "test", "data" => $channel), 5);
            echo "<div class='return'>" . $json . "</div>";
            break;
        case "deactivate":
            $service = new ServiceWrapper("http://local.swiftcore.com/ServiceAPI/ChannelProcessingJobServices/ListAllChannelProcessingJobs.php");
            $json = $service->MakePOSTRequest(array("key" => "test"), 5);
            $channels = json_decode($json);
            $channels = $channels->{"channels"};
            $service = new ServiceWrapper("http://local.swiftcore.com/ServiceAPI/ChannelProcessingJobServices/DeactivateChannelProcessingJob.php");
            $channel = json_encode($channels[$_POST["channelNumber"]]);
            $json = $service->MakePOSTRequest(array("key" => "test", "data" => $channel), 5);
            echo "<div class='return'>" . $json . "</div>";
            break;
    }
}
$service = new ServiceWrapper("http://local.swiftcore.com/ServiceAPI/ChannelProcessingJobServices/ListAllChannelProcessingJobs.php");
$json = $service->MakePOSTRequest(array("key" => "test"), 5);
echo "<div class='return'>" . $json . "</div>";
$channels = json_decode($json);
$channels = $channels->{"channels"};
?>
<html>
    <head>
        <title>Channel Processing Job Interface Tests</title>
        <style type="text/css">
            div.return { background-color:#F33; padding:20px; border:3px #A00 solid;}
            body { background-color:black; color:white; }
            body div.page { width:80%; margin-left:auto; margin-right:auto; margin-top:20px; }
            body div.page div.container { border:3px solid #333; margin-bottom:10px;}
            body div.page div.container h2 { padding:10px; margin:0 0 20px 0; background-color:#333; }
            body div.page div.container table.channel-processing-jobs { padding:10px; }