- Move 12 markdown files from root to docs/ subdirectories - Organize documentation by category: • docs/troubleshooting/ (1 file) - Technical troubleshooting guides • docs/deployment/ (4 files) - Deployment and security documentation • docs/guides/ (3 files) - Feature-specific guides • docs/planning/ (4 files) - Planning and improvement proposals Root directory cleanup: - Reduced from 16 to 4 markdown files in root - Only essential project files remain: • CLAUDE.md (AI instructions) • README.md (Main project readme) • CLEANUP_PLAN.md (Current cleanup plan) • SRC_STRUCTURE_IMPROVEMENTS.md (Structure improvements) This improves: ✅ Documentation discoverability ✅ Logical organization by purpose ✅ Clean root directory ✅ Better maintainability
65 lines
2.6 KiB
PHP
65 lines
2.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit\Framework\Logging;
|
|
|
|
use App\Framework\Logging\LogChannel;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class LogChannelTest extends TestCase
|
|
{
|
|
public function test_can_get_log_path_key(): void
|
|
{
|
|
expect(LogChannel::APP->getLogPathKey())->toBe('app');
|
|
expect(LogChannel::SECURITY->getLogPathKey())->toBe('security');
|
|
expect(LogChannel::CACHE->getLogPathKey())->toBe('cache');
|
|
expect(LogChannel::DATABASE->getLogPathKey())->toBe('database');
|
|
expect(LogChannel::FRAMEWORK->getLogPathKey())->toBe('framework');
|
|
expect(LogChannel::ERROR->getLogPathKey())->toBe('error');
|
|
}
|
|
|
|
public function test_can_get_description(): void
|
|
{
|
|
expect(LogChannel::APP->getDescription())->toBe('Application logs');
|
|
expect(LogChannel::SECURITY->getDescription())->toBe('Security events and authentication logs');
|
|
expect(LogChannel::CACHE->getDescription())->toBe('Cache operations and debugging');
|
|
expect(LogChannel::DATABASE->getDescription())->toBe('Database queries and operations');
|
|
expect(LogChannel::FRAMEWORK->getDescription())->toBe('Framework internals and debugging');
|
|
expect(LogChannel::ERROR->getDescription())->toBe('Error-specific logs');
|
|
}
|
|
|
|
public function test_can_get_all_channels(): void
|
|
{
|
|
$channels = LogChannel::getAllChannels();
|
|
|
|
expect($channels)->toBeArray();
|
|
expect($channels)->toHaveCount(6);
|
|
|
|
expect($channels['app'])->toBe('Application logs');
|
|
expect($channels['security'])->toBe('Security events and authentication logs');
|
|
expect($channels['cache'])->toBe('Cache operations and debugging');
|
|
expect($channels['database'])->toBe('Database queries and operations');
|
|
expect($channels['framework'])->toBe('Framework internals and debugging');
|
|
expect($channels['error'])->toBe('Error-specific logs');
|
|
}
|
|
|
|
public function test_enum_values_are_correct(): void
|
|
{
|
|
expect(LogChannel::APP->value)->toBe('app');
|
|
expect(LogChannel::SECURITY->value)->toBe('security');
|
|
expect(LogChannel::CACHE->value)->toBe('cache');
|
|
expect(LogChannel::DATABASE->value)->toBe('database');
|
|
expect(LogChannel::FRAMEWORK->value)->toBe('framework');
|
|
expect(LogChannel::ERROR->value)->toBe('error');
|
|
}
|
|
|
|
public function test_all_enum_cases_are_covered(): void
|
|
{
|
|
$expectedCases = ['app', 'security', 'cache', 'database', 'framework', 'error'];
|
|
$actualCases = array_map(fn ($case) => $case->value, LogChannel::cases());
|
|
|
|
expect($actualCases)->toBe($expectedCases);
|
|
}
|
|
}
|