67 lines
1.8 KiB
Markdown
67 lines
1.8 KiB
Markdown
# Testing Patterns
|
|
|
|
**Analysis Date:** 2026-04-27
|
|
|
|
## Test Framework
|
|
|
|
**Runner:**
|
|
- None — no test framework detected in the codebase
|
|
|
|
**Assertion Library:**
|
|
- None
|
|
|
|
**Run Commands:**
|
|
- No test commands defined
|
|
|
|
## Test File Organization
|
|
|
|
**Location:**
|
|
- No test files exist anywhere in `_rejestracja/`
|
|
|
|
**Naming:**
|
|
- N/A — no test files
|
|
|
|
## Current Verification Approach
|
|
|
|
All verification is manual:
|
|
|
|
1. **PHP syntax check** — `php -l {file}` run manually or via IDE
|
|
2. **Browser smoke test** — manually load registration form, submit, check DB/email
|
|
3. **Admin panel check** — manually verify `/_rejestracja/Admin/Calc/Reg` renders correctly
|
|
4. **Migration runner** — run `apply-*.php?run=YYYYMMDD` and read output message
|
|
|
|
## Test Coverage Gaps
|
|
|
|
**Everything is untested:**
|
|
- Form submission and validation logic in `IndexController.php`
|
|
- Model field mapping in `MfParticipant.class.php` (especially `$fields` array)
|
|
- DAL query generation in `DefaultDAL.class.php`
|
|
- Email sending logic
|
|
- Payment status calculation
|
|
- Smarty plugin behavior (`{translate}`, `{formField}`, `{url}`)
|
|
- Migration runners (idempotency)
|
|
|
|
## Adding Tests (if introduced)
|
|
|
|
If a test framework were added to this PHP project:
|
|
|
|
**Recommended framework:** PHPUnit (standard PHP unit testing)
|
|
|
|
**What would be easiest to test first:**
|
|
- Model getter/setter roundtrips (pure PHP, no DB)
|
|
- `Validator` class required-field checks
|
|
- Price calculation logic (if extracted from controller)
|
|
|
|
**What would require infrastructure:**
|
|
- DAL tests (require MySQL connection)
|
|
- Full controller tests (require HTTP or simulated request context)
|
|
- Email tests (require mock or captured SMTP)
|
|
|
|
**Key constraint:**
|
|
- PHP 5.x compatibility required — PHPUnit 4.x or 5.x (not modern versions)
|
|
|
|
---
|
|
|
|
*Testing analysis: 2026-04-27*
|
|
*Update if a test framework is introduced*
|