- 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.
75 lines
2.5 KiB
PHP
75 lines
2.5 KiB
PHP
<?php
|
|
if(!defined('LIMONADE')){$h="HTTP/1.0 401 Unauthorized";header($h);die($h);}// Security check
|
|
|
|
test_case("File");
|
|
test_case_describe("Testing limonade file functions.");
|
|
|
|
function before_each_test_in_file()
|
|
{
|
|
|
|
}
|
|
|
|
function test_file_mime_type()
|
|
{
|
|
$mimes = mime_type();
|
|
assert_true(is_array($mimes));
|
|
assert_not_empty($mimes);
|
|
assert_empty(mime_type(''));
|
|
assert_null(mime_type('unknown_extension'));
|
|
assert_equal(mime_type('txt'), 'text/plain');
|
|
assert_equal(mime_type('TXT'), 'text/plain');
|
|
assert_equal(mime_type('jpg'), 'image/jpeg');
|
|
assert_equal(mime_type('JPG'), 'image/jpeg');
|
|
}
|
|
|
|
function test_file_extension()
|
|
{
|
|
assert_equal(file_extension('my_file'), '');
|
|
assert_equal(file_extension('my_file.txt'), 'txt');
|
|
assert_equal(file_extension('my_file.html.php'), 'php');
|
|
assert_equal(file_extension('my_file.JPG'), 'JPG');
|
|
}
|
|
|
|
function test_file_mime_content_type()
|
|
{
|
|
assert_not_empty(file_mime_content_type(''));
|
|
assert_not_empty(file_mime_content_type('my_file'));
|
|
assert_equal(file_mime_content_type('my_file'), 'application/octet-stream');
|
|
assert_equal(file_mime_content_type('my_file.txt'), 'text/plain');
|
|
assert_equal(file_mime_content_type('my_file.TXT'), 'text/plain');
|
|
assert_equal(file_mime_content_type('my_file.jpg'), 'image/jpeg');
|
|
assert_equal(file_mime_content_type('my_file.JPG'), 'image/jpeg');
|
|
}
|
|
|
|
function test_file_is_text()
|
|
{
|
|
assert_true(file_is_text('my_file.txt'));
|
|
assert_true(file_is_text('my_file.TXT'));
|
|
assert_true(file_is_text('my_file.css'));
|
|
assert_true(file_is_text('my_file.csv'));
|
|
assert_false(file_is_text('my_file.jpg'));
|
|
}
|
|
|
|
function test_file_is_binary()
|
|
{
|
|
assert_false(file_is_binary('my_file.txt'));
|
|
assert_false(file_is_binary('my_file.TXT'));
|
|
assert_false(file_is_binary('my_file.css'));
|
|
assert_false(file_is_binary('my_file.csv'));
|
|
assert_true(file_is_binary('my_file.jpg'));
|
|
assert_true(file_is_binary('my_file.swf'));
|
|
}
|
|
|
|
function test_file_path()
|
|
{
|
|
$p = "/one/two/three";
|
|
assert_equal(file_path('/one','two','three'), $p);
|
|
assert_equal(file_path('/one','/two','three'), $p);
|
|
assert_equal(file_path('/one','two','///three'), $p);
|
|
assert_equal(file_path('/one','two','three/'), $p.'/');
|
|
assert_equal(file_path('/one','two','three//'), $p.'/');
|
|
assert_equal(file_path('/one', '\two', '\\three//'), $p.'/');
|
|
}
|
|
|
|
end_test_case();
|