• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

move-elevator / typo3-image-compression / 35981638346

24 Sep 2026 09:30AM UTC coverage: 89.805% (-0.8%) from 90.598%
35981638346

push

github

web-flow
feat: add backup and restore for original files before compression (#59)

* feat: add backup and restore for original files before compression

* test: cover backup and restore functionality

* docs: document backup and restore feature

* fix: avoid mocking readonly IconFactory and declare psr/http-message explicitly

* refactor: apply rector fixes and skip TYPO3-13+-only IconSize migration

* fix: replace readonly-incompatible IconFactory test double with a real, cache-seeded instance

* fix: replace PHPUnit-based IconFactory double with framework-free version-agnostic stand-in

* fix: require CSRF token and file-replace permission before restoring a backup

The restore action accepted any authenticated backend request with a
file UID, without verifying the request originated from the file list
UI or that the user may actually replace that file. Also skip
rendering the restore action entirely when backups are disabled.

* fix: clear stale backup-path references and reindex FAL metadata after restore

sys_file.backup_path could point at a file that pruning had already
deleted, and a restored file's size/hash were never refreshed in the
FAL index, leaving both out of sync with what is actually on disk.

* fix: avoid doubling readonly ResourceFactory in RestoreFileController's unit tests

Some resolvable PHPUnit/mock-object versions refuse to double a class
TYPO3 declares readonly (ResourceFactory, since 13.4), throwing
ClassIsReadonlyException instead of a usable test double. The
"file exists" cases now seed a real, reflection-instantiated
ResourceFactory's internal cache directly; the "file does not exist"
case moved to a functional test, which needs a real, DB-backed
ResourceFactory/FileIndexRepository lookup anyway.

* fix: cover file-permission scenarios with a real backend user instead of a ResourceFactory double

ResourceFactory's internal instance-cache property isn't stable across
the supported TYPO3 versions either, so reflecting it (like the
... (continued)

245 of 287 new or added lines in 14 files covered. (85.37%)

1700 of 1893 relevant lines covered (89.8%)

4.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.95
/Classes/Domain/Repository/FileRepository.php


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc