- Added comprehensive AI Assistant system (aiassist/ directory): * Vector search and embedding capabilities * Typebot proxy integration * Elastic search functionality * Message classification and chat history * MCP proxy for external integrations - Implemented Court Status API (GetCourtStatus.php): * Real-time court document status checking * Integration with external court systems * Comprehensive error handling and logging - Enhanced S3 integration: * Improved file backup system with metadata * Batch processing capabilities * Enhanced error logging and recovery * Copy operations with URL fixing - Added Telegram contact creation API - Improved error logging across all modules - Enhanced callback system for AI responses - Extensive backup file storage with timestamps - Updated documentation and README files - File storage improvements: * Thousands of backup files with proper metadata * Fix operations for broken file references * Project-specific backup and recovery systems * Comprehensive file integrity checking Total: 26,461+ files added/modified including AWS SDK, vendor dependencies, and extensive backup system.
60 lines
2.1 KiB
PHP
60 lines
2.1 KiB
PHP
<?php
|
|
if(!defined('LIMONADE')){$h="HTTP/1.0 401 Unauthorized";header($h);die($h);}// Security check
|
|
|
|
test_case("HTTP");
|
|
test_case_describe("Testing limonade HTTP utils functions.");
|
|
|
|
function test_http_response_status_code()
|
|
{
|
|
$response = test_request(TESTS_DOC_ROOT.'02-outputs.php/render0', 'GET', true);
|
|
assert_match("/HTTP\/1\./", $response);
|
|
assert_status($response, 200);
|
|
}
|
|
|
|
function test_http_ua_accepts()
|
|
{
|
|
$env = env();
|
|
|
|
$env['SERVER']['HTTP_ACCEPT'] = null;
|
|
assert_true(http_ua_accepts('text/plain'));
|
|
|
|
$env['SERVER']['HTTP_ACCEPT'] = 'text/html';
|
|
assert_true(http_ua_accepts('html'));
|
|
|
|
$env['SERVER']['HTTP_ACCEPT'] = 'text/*; application/json';
|
|
assert_true(http_ua_accepts('html'));
|
|
assert_true(http_ua_accepts('text/html'));
|
|
assert_true(http_ua_accepts('text/plain'));
|
|
assert_true(http_ua_accepts('application/json'));
|
|
|
|
assert_false(http_ua_accepts('image/png'));
|
|
assert_false(http_ua_accepts('png'));
|
|
|
|
assert_true(defined('TESTS_DOC_ROOT'), "Undefined 'TESTS_DOC_ROOT' constant");
|
|
|
|
$response = test_request(TESTS_DOC_ROOT.'05-content_negociation.php', 'GET', false, array(), array("Accept: image/png"));
|
|
assert_equal("Oops", $response);
|
|
|
|
$response = test_request(TESTS_DOC_ROOT.'05-content_negociation.php', 'GET', false, array(), array("Accept: text/html"));
|
|
assert_equal("<h1>HTML</h1>", $response);
|
|
|
|
$response = test_request(TESTS_DOC_ROOT.'05-content_negociation.php', 'GET', false, array(), array("Accept: application/json"));
|
|
assert_equal("json", $response);
|
|
}
|
|
|
|
function test_http_redirect()
|
|
{
|
|
$url = TESTS_DOC_ROOT.'09-redirect.php?/';
|
|
|
|
$response = test_request($url, 'GET');
|
|
assert_equal($response, '/redirected');
|
|
|
|
$response = test_request($url.'&key1=value1', 'GET');
|
|
assert_equal($response, '/redirected&key1=value1');
|
|
|
|
$response = test_request($url.'&key1=value1&key2=value2', 'GET');
|
|
assert_equal($response, '/redirected&key1=value1&key2=value2');
|
|
}
|
|
|
|
end_test_case();
|