Files
FHC-Core/application/controllers/api/v1/Test.php
T
bison-paolo d96a0e98d5 - Fixed codeception test
- Updated the api test suite
- Added the script generate.php to automatically generate the test cases
for the controllers
2016-11-23 15:09:10 +01:00

53 lines
1.1 KiB
PHP

<?php
if (! 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 APIv1_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',
'error' => 0
];
$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',
'error' => 0
];
$httpstatus = REST_Controller::HTTP_OK;
$this->response($payload, $httpstatus);
}
}