feat: 初始化知识库系统项目

- 实现基于 Laravel 11 和 Filament 3.X 的文档管理系统
- 添加用户认证和分组管理功能
- 实现文档上传、分类和权限控制
- 集成 Word 文档自动转换为 Markdown
- 集成 Meilisearch 全文搜索引擎
- 实现文档在线预览功能
- 添加安全日志和审计功能
- 完整的简体中文界面
- 包含完整的项目文档和部署指南

技术栈:
- Laravel 11.x
- Filament 3.X
- Meilisearch 1.5+
- Pandoc 文档转换
- Redis 队列系统
- Pest PHP 测试框架
This commit is contained in:
Knowledge Base System
2025-12-05 14:44:44 +08:00
commit acf549c43c
165 changed files with 32838 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class SetupTest extends TestCase
{
use RefreshDatabase;
/**
* 测试应用语言配置为简体中文
*/
public function test_app_locale_is_chinese(): void
{
$this->assertEquals('zh_CN', config('app.locale'));
$this->assertEquals('zh_CN', config('app.fallback_locale'));
}
/**
* 测试数据库连接正常
*/
public function test_database_connection(): void
{
// 测试数据库连接是否正常
$this->assertDatabaseCount('users', 0); // 测试数据库初始为空
// 创建一个测试用户
\App\Models\User::factory()->create([
'email' => 'test@example.com',
]);
$this->assertDatabaseCount('users', 1);
$this->assertDatabaseHas('users', [
'email' => 'test@example.com',
]);
}
/**
* 测试 Filament 管理面板路由可访问
*/
public function test_filament_admin_routes_exist(): void
{
$response = $this->get('/admin/login');
$response->assertStatus(200);
}
/**
* 测试中文翻译文件存在
*/
public function test_chinese_translation_files_exist(): void
{
$this->assertFileExists(lang_path('zh_CN/auth.php'));
$this->assertFileExists(lang_path('zh_CN/validation.php'));
$this->assertFileExists(lang_path('vendor/filament/zh_CN/components/button.php'));
}
}