diff --git a/src/Interfaces/ProjectInterface.php b/src/Interfaces/ProjectInterface.php index 234a665..c3073b2 100644 --- a/src/Interfaces/ProjectInterface.php +++ b/src/Interfaces/ProjectInterface.php @@ -18,8 +18,8 @@ */ interface ProjectInterface { - const VERSION = '0.1.3.11'; - const LAST_MODIFIED = '2018-10-18'; + const VERSION = '0.1.3.12'; + const LAST_MODIFIED = '2018-11-07'; const MIN_PHP_VERSION = '5.3'; const GET = 'GET'; const HEAD = 'HEAD'; diff --git a/tests/test_helper_debug.php b/tests/test_helper_debug.php index e1d1c32..491ca91 100644 --- a/tests/test_helper_debug.php +++ b/tests/test_helper_debug.php @@ -24,26 +24,26 @@ 'email' => 'dev@nguyenanhung.com' ]; // Call -$debug = new Debug(); -$debug->setDebugStatus(TRUE); -$debug->setLoggerPath($logPath); -$debug->setLoggerSubPath($logSubPath); -$debug->setLoggerFilename($logFilename); +$Debug = new Debug(); +$Debug->setDebugStatus(TRUE); +$Debug->setLoggerPath($logPath); +$Debug->setLoggerSubPath($logSubPath); +$Debug->setLoggerFilename($logFilename); echo "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; -echo "\n getVersion: " . $debug->getVersion() . "\n"; -echo "\n setDebugStatus: " . $debug->getDebugStatus() . "\n"; -echo "\n setLoggerPath: " . $debug->getLoggerPath() . "\n"; -echo "\n setLoggerSubPath: " . $debug->getLoggerSubPath() . "\n"; -echo "\n setLoggerFilename: " . $debug->getLoggerFilename() . "\n"; +echo "\n getVersion: " . $Debug->getVersion() . "\n"; +echo "\n setDebugStatus: " . $Debug->getDebugStatus() . "\n"; +echo "\n setLoggerPath: " . $Debug->getLoggerPath() . "\n"; +echo "\n setLoggerSubPath: " . $Debug->getLoggerSubPath() . "\n"; +echo "\n setLoggerFilename: " . $Debug->getLoggerFilename() . "\n"; echo "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; -d($debug->debug($name, $msg . ' - DEBUG', $context)); -d($debug->info($name, $msg . ' - INFO', $context)); -d($debug->notice($name, $msg . ' - NOTICE', $context)); -d($debug->warning($name, $msg . ' - WARNING', $context)); -d($debug->error($name, $msg . ' - ERROR', $context)); -d($debug->critical($name, $msg . ' - CRITICAL', $context)); -d($debug->alert($name, $msg . ' - ALERT', $context)); -d($debug->emergency($name, $msg . ' - EMERGENCY', $context)); +d($Debug->debug($name, $msg . ' - DEBUG', $context)); +d($Debug->info($name, $msg . ' - INFO', $context)); +d($Debug->notice($name, $msg . ' - NOTICE', $context)); +d($Debug->warning($name, $msg . ' - WARNING', $context)); +d($Debug->error($name, $msg . ' - ERROR', $context)); +d($Debug->critical($name, $msg . ' - CRITICAL', $context)); +d($Debug->alert($name, $msg . ' - ALERT', $context)); +d($Debug->emergency($name, $msg . ' - EMERGENCY', $context)); diff --git a/tests/tests.php b/tests/tests.php deleted file mode 100644 index 892cbb7..0000000 --- a/tests/tests.php +++ /dev/null @@ -1,38 +0,0 @@ - - * Date: 10/4/18 - * Time: 14:54 - */ - -use nguyenanhung\MyRequests\SendRequests; - -$debug = [ - 'debugStatus' => TRUE, - 'debugLoggerPath' => testLogPath() -]; -$url = 'http://vcms.gviet.vn/api/v1/shared-content/vietlott.html'; -$data = [ - 'date' => date('Y-m-d'), - 'service' => 'ME', - 'token' => 'empty' -]; -$method = 'GET'; -$headers = []; -$options = []; -$request = new SendRequests(); -$request->debugStatus = TRUE; -$request->debugLoggerPath = testLogPath(); -$request->__construct(); -$request->setHeader($headers); -$request->setOptions($options); - -$result = $request->pyRequest($url, $data, $method); - -var_dump($result); \ No newline at end of file diff --git a/tests/tests_get_contents.php b/tests/tests_get_contents.php index 4ee5ac9..c8bb8fa 100644 --- a/tests/tests_get_contents.php +++ b/tests/tests_get_contents.php @@ -22,15 +22,15 @@ ]; $method = 'GET'; // Let's Go -$content = new GetContents(); -$content->setURL($url); -$content->setMethod($method); -$content->setData($data); -$content->sendRequest(); +$GetContents = new GetContents(); +$GetContents->setURL($url); +$GetContents->setMethod($method); +$GetContents->setData($data); +$GetContents->sendRequest(); -$response = $content->response(); -$getContent = $content->getContent(); -$getError = $content->getError(); +$response = $GetContents->response(); +$getContent = $GetContents->getContent(); +$getError = $GetContents->getError(); d($response); d($getContent); diff --git a/tests/tests_send_requests.php b/tests/tests_send_requests.php index a694070..f9927d8 100644 --- a/tests/tests_send_requests.php +++ b/tests/tests_send_requests.php @@ -26,21 +26,21 @@ $method = 'GET'; $headers = []; $options = []; -$request = new MyRequests(); -$request->debugStatus = TRUE; -$request->debugLoggerPath = testLogPath(); -$request->__construct(); -$request->setHeader($headers); -$request->setOptions($options); +$MyRequests = new MyRequests(); +$MyRequests->debugStatus = TRUE; +$MyRequests->debugLoggerPath = testLogPath(); +$MyRequests->__construct(); +$MyRequests->setHeader($headers); +$MyRequests->setOptions($options); -$pyRequest = $request->pyRequest($url, $data, $method); +$pyRequest = $MyRequests->pyRequest($url, $data, $method); d($pyRequest); -$guzzlePhpRequest = $request->guzzlePhpRequest($url, $data, $method); +$guzzlePhpRequest = $MyRequests->guzzlePhpRequest($url, $data, $method); d($guzzlePhpRequest); -$curlRequest = $request->curlRequest($url, $data, $method); +$curlRequest = $MyRequests->curlRequest($url, $data, $method); d($curlRequest); -$sendRequest = $request->sendRequest($url, $data, $method); -d($sendRequest); \ No newline at end of file +$sendRequest = $MyRequests->sendRequest($url, $data, $method); +d($sendRequest);