chore: modernize dependencies and add Docker dev/test environment - #58
Merged
Merged
Conversation
Completes and verifies an in-flight upgrade that was sitting uncommitted
and had never been run, then brings the remaining tooling up to date.
Dependencies:
- phpunit/phpunit 12.5 -> 13.3 (config migrated to the 13.3 schema)
- kreait/firebase-php 7 -> 8, with the persistence layer reworked so the
repository talks to a narrow DatabaseInterface (getValue/exists/push/
update/remove) instead of passing Firebase Reference objects around
- actions/checkout v5 -> v7, actions/cache v4 -> v6
- CI now runs PHP 8.4 with xdebug for coverage
Docker:
- Add a Dockerfile pinning PHP 8.4 + Composer + Xdebug (coverage mode
only, so the container never blocks waiting for an IDE)
- Add a one-shot `cli` compose service for composer/phpunit, and drop the
obsolete compose `version` key
Test fixes surfaced by PHPUnit 13:
- Add explicit expects() to seven `->method()->with()` calls; using with()
without expects() is removed in PHPUnit 14. Each is a single-call path,
so this tightens the assertions rather than just silencing the warning.
- Replace the expectation-less mock in testCreateTodoEmptyName with an
expects($this->never())->method('push'), which actually asserts that
name validation runs before any database write.
Verified in Docker: composer validate --strict, a clean vendor install,
composer audit (no advisories), and 38 tests / 100 assertions passing with
zero deprecations or notices. Server boots and serves / and 404s.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
hjemmel
added a commit
that referenced
this pull request
Aug 11, 2026
chore: modernize dependencies and add Docker dev/test environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch started from an in-flight upgrade that was sitting uncommitted in the working tree and had never been run — kreait/firebase-php 7→8, PHPUnit 12.5, PHP 8.4 in CI, plus a rewrite of the Firebase persistence layer. The first job was proving it actually worked; then bringing the rest of the tooling current.
Everything here was built and verified inside Docker.
Dependencies
kreait/firebase-php8.4.0,slim/slim4.15.2,php-di7.1.1,monolog3.10.0 andslim/psr71.8.0 were already current —composer outdated --directnow reports nothing.The firebase-php 7→8 move reworks the persistence layer so
FirebaseTodoRepositorytalks to a narrowDatabaseInterface(getValue/exists/push/update/remove) instead of passing FirebaseReferenceobjects around.DatabaseWrapper::push()guards thegetKey(): ?stringnull case explicitly.Docker
Dockerfile: PHP 8.4 + Composer 2 + Xdebug, pinned toxdebug.mode=coverageso the container never stalls waiting for an IDE.docker-compose.yml: dropped the obsoleteversion: '3.7'key, added a one-shotcliservice.Test fixes surfaced by PHPUnit 13
All in
FirebaseTodoRepositoryTest.php— 7 deprecations + 1 notice, now zero:->method()->with()withoutexpects()is removed in PHPUnit 14. Added explicitexpects($this->once())to all seven. Each is genuinely a single-call path, so this tightens the assertions rather than just silencing the warning (95 → 100 assertions).testCreateTodoEmptyNamebecameexpects($this->never())->method('push'), which now actually asserts that name validation runs before any database write.Verification
Clean-room run in the container:
composer validate --strict✅rm -rf vendor+ freshcomposer install✅composer audit→ no security advisories ✅ (GitHub currently reports 17 Dependabot alerts onmaster)/→ 200,/nope→ 404 ✅/todosreturns 500 without apublic/firebase-key.json, which is expected and is a missing-credentials error, not an API break. SinceDatabaseWrapperis the one class the tests never touch (Kreait\Firebase\Database\Referenceisfinaland can't be mocked), I confirmed the v8 API surface by reflection instead:Factory::withServiceAccount/withDatabaseUri/createDatabase,Contract\Database,Reference::push/getKey.Follow-ups not included here
app/settings.php— a hardcoded Firebase database URL and secret key, committed and in git history. Nothing readssettings['firebase'], so it is dead config. Left untouched deliberately rather than silently changing a secret; recommend deleting it and rotating the key.DatabaseWrapperhas no test coverage — covering it needs an integration test against the Firebase emulator, sinceReferenceisfinal.🤖 Generated with Claude Code