Add comprehensive unit tests for Security, UserModel, and Validation utilities
- Implemented SecurityTest to validate token generation, CSRF protection, input sanitization, and rate limiting. - Created UserModelTest to ensure correct database operations for user management, including creation, updating, banning, and fetching active users. - Developed ValidationTest to verify input validation and sanitization for user IDs, nicknames, messages, and API requests. - Introduced Security and Validation utility classes with methods for secure token generation, input sanitization, and comprehensive validation rules.
This commit is contained in:
parent
5692874b10
commit
41cd7a4fd8
32 changed files with 5796 additions and 368 deletions
76
.gitignore
vendored
76
.gitignore
vendored
|
|
@ -1,14 +1,74 @@
|
|||
# Built/minified assets
|
||||
assets/**/*.min.css
|
||||
assets/**/*.min.js
|
||||
# Dependencies
|
||||
/vendor/
|
||||
/node_modules/
|
||||
|
||||
# Distribution directory
|
||||
assets/dist/
|
||||
# Environment files
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Logs and cache
|
||||
/logs/
|
||||
/cache/
|
||||
*.log
|
||||
logs/app.log
|
||||
logs/*.log
|
||||
|
||||
# Test artifacts
|
||||
/tests/coverage/
|
||||
/tests/results/
|
||||
/test-results/
|
||||
/coverage.xml
|
||||
phpunit.xml.bak
|
||||
|
||||
# File-based storage (migrated to database)
|
||||
active_viewers.json
|
||||
chat_messages.json
|
||||
banned_users.json
|
||||
*.json.tmp
|
||||
*.json.backup
|
||||
|
||||
# Temporary files
|
||||
*.tmp
|
||||
*.bak
|
||||
|
||||
# OS-specific files
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# IDE and editor files
|
||||
.vscode/
|
||||
.idea/
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
|
||||
# OS generated files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
# Backup files
|
||||
*.backup
|
||||
*.bak
|
||||
*~
|
||||
*.orig
|
||||
|
||||
# Documentation artifacts
|
||||
/docs/phpdoc/
|
||||
|
||||
# Docker (if used)
|
||||
.dockerignore
|
||||
docker-compose.override.yml
|
||||
|
||||
# Sensitive files
|
||||
config/production.php
|
||||
config/staging.php
|
||||
*.key
|
||||
*.pem
|
||||
|
||||
# Migration backups
|
||||
migrations/*.migrated
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue