Files
FHC-Core/application/controllers/api/Test.php
T
paolo 78e4c2900b Merge origin/ci into ci
Conflicts:
	application/config/rest.php
	application/libraries/FHC_Auth.php
	tests/codeception/api/LoginCept.php
2016-04-20 17:57:55 +02:00

50 lines
1.1 KiB
PHP

<?php
defined('BASEPATH') || exit('No direct script access allowed');
require_once APPPATH . '/libraries/REST_Controller.php';
/**
* Testing class for REST calls and authentication
*/
class Test extends REST_Controller
{
public function __construct()
{
parent::__construct();
}
/**
* Test HTTP GET method
* It responses whith the HTTP status 200 and prints this JSON string
* {"success":true,"message":"API HTTP GET call test succeed"}
*
* @return void
*/
public function getTest()
{
$payload = [
'success' => TRUE,
'message' => 'API HTTP GET call test succeed'
];
$httpstatus = REST_Controller::HTTP_OK;
$this->response($payload, $httpstatus);
}
/**
* Test HTTP POST method
* * It responses whith the HTTP status 200 and prints this JSON string
* {"success":true,"message":"API HTTP POST call test succeed"}
*
* @return void
*/
public function postTest()
{
$payload = [
'success' => TRUE,
'message' => 'API HTTP POST call test succeed'
];
$httpstatus = REST_Controller::HTTP_OK;
$this->response($payload, $httpstatus);
}
}