Skip to content

feat: unit + feature tests (51 passing), SQLite test env, bug fixes#130

Open
kaliclawp wants to merge 2 commits intoPhilhil:masterfrom
kaliclawp:feature/unit-tests
Open

feat: unit + feature tests (51 passing), SQLite test env, bug fixes#130
kaliclawp wants to merge 2 commits intoPhilhil:masterfrom
kaliclawp:feature/unit-tests

Conversation

@kaliclawp
Copy link
Copy Markdown
Contributor

Test files added:

  • tests/Unit/UserModelTest.php (role checks, qualification assignment)
  • tests/Feature/AuthTest.php (login, logout, registration, spam honeypot)
  • tests/Feature/ServiceManagementTest.php (service CRUD, position subscribe/authorize)
  • tests/Feature/TrainingManagementTest.php (training CRUD, training editor role)
  • tests/Feature/HolidayTest.php (holiday CRUD, service/training blocking, shortcuts)

Infrastructure changes:

  • phpunit.xml: switch to SQLite :memory: for tests, set APP_KEY, IS_DEMO=true, disable Telescope, captcha bypass env vars
  • .env.testing: generated APP_KEY added
  • config/backup.php: fallback email for spatie/laravel-backup (null-safe)

App fixes discovered via tests:

  • Replace all DB::raw('CURDATE()') with now()->toDateString() (SQLite compat)
  • Migration 2019_05_29: skip dropForeign by name on SQLite
  • RegisterController: bypass captcha in testing env
  • Qualification: add client_id to fillable
  • Client_user: add isTrainingEditor, isStatisticEditor, approved to fillable

kaliclawp and others added 2 commits March 23, 2026 19:26
Test files added:
- tests/Unit/UserModelTest.php (role checks, qualification assignment)
- tests/Feature/AuthTest.php (login, logout, registration, spam honeypot)
- tests/Feature/ServiceManagementTest.php (service CRUD, position subscribe/authorize)
- tests/Feature/TrainingManagementTest.php (training CRUD, training editor role)
- tests/Feature/HolidayTest.php (holiday CRUD, service/training blocking, shortcuts)

Infrastructure changes:
- phpunit.xml: switch to SQLite :memory: for tests, set APP_KEY, IS_DEMO=true,
  disable Telescope, captcha bypass env vars
- .env.testing: generated APP_KEY added
- config/backup.php: fallback email for spatie/laravel-backup (null-safe)

App fixes discovered via tests:
- Replace all DB::raw('CURDATE()') with now()->toDateString() (SQLite compat)
- Migration 2019_05_29: skip dropForeign by name on SQLite
- RegisterController: bypass captcha in testing env
- Qualification: add client_id to fillable
- Client_user: add isTrainingEditor, isStatisticEditor, approved to fillable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant