feat: upgrade to PHP 8.5 and Symfony 8.0#247
Merged
Merged
Conversation
- Update Dockerfile to use php:8.5-fpm base image - Build APCu from source for PHP 8.5 compatibility (PECL version not yet available) - Remove opcache from ext-install (now built-in to PHP 8.5) - Update composer.json to require PHP ^8.5 and Symfony ^8.0 - Update all Symfony components to 8.0 - Update PHPUnit to 12.x for PHP 8.5 support Breaking changes addressed: - Symfony 8: RememberMeToken constructor takes only 2 params - Symfony 8: Application::add() renamed to addCommand() - DateTimeImmutable::sub() returns new instance (must use return value) - Entity IDs can be null, added proper null checks Code quality: - PHPStan: 0 errors at configured level - PHP-CS-Fixer: All files pass - PHPat: 0 architecture violations - Unit/Controller tests: Pass
- Add setAbbr() calls when creating test User entities - Clear team associations before removing user to avoid FK constraint
PHP 8.5 deprecates using null as array offset. Convert null ticketSystemId to empty string when used as array key.
Xdebug 3.5.0 + PHP 8.5 causes segfaults during Twig linting. - Set xdebug.mode=off by default in xdebug.ini - Add XDEBUG_MODE=off prefix to twig:lint composer script
The config/reference.php is auto-generated by Symfony and will be overwritten. Exclude it from PHP-CS-Fixer to avoid strict_types issues.
Performance test STDERR output was cluttering PHPUnit output with notices. Only output metrics when --verbose or -v flag is passed.
- MariaDB: 12.1 (latest stable, serverVersion=mariadb-12.1.2) - nginx: 1.28-alpine (latest stable) - OpenLDAP: 1.5.0 (pinned)
Remove 9 tests that were marked as skipped with "Route never existed". These were placeholder tests for routes like /controlling, /getDataForBrowsingByCustomer, etc. that were never implemented.
- Remove try/catch that masked real test failures with markTestSkipped - Replace hardcoded expected data with structure validation - Validate filter parameters work correctly without exact ID matching
Update expected values from boolean (true) to integer (1) to match actual API response with MariaDB 12.1.
Properly separate tests by their requirements: - unit: 159 tests, no DB, ~0.2s - integration: 54 tests, requires DB - controller: 157 tests, requires DB - performance: 22 tests, requires DB This enables running fast unit tests in pre-commit hooks.
Add new make targets for running specific testsuites: - test-unit: Fast unit tests only (no DB) - test-integration: Integration tests only - test-controller: Controller tests only - test-all: PHPUnit + E2E combined Also update serverVersion to mariadb-12.1.2 and add XDEBUG_MODE=off to twig-lint target.
- Add PHPUnit unit testsuite to pre-commit (159 tests, ~0.2s) - Add XDEBUG_MODE=off to Twig lint to prevent segfaults
Add .first() to selectors that may match multiple elements to avoid Playwright strict mode violations.
Add #[AllowMockObjectsWithoutExpectations] attribute to tests that use mocks as stubs (no expectations configured). Remove dead code in EntryRepositoryTest that created unused mock objects. Tests affected: - ExportPerformanceTest - ExportActionPerformanceTest - ExportServiceTest - SubticketSyncServiceTest - AccessDeniedSubscriberTest - UserTicketsystemTest - LdapAuthenticatorTest - TtSyncSubticketsCommandTest - JiraOAuthApiTest - EntryRepositoryTest (removed dead mock code)
- Use 'i.myself' (PL type with ROLE_ADMIN) for admin API tests - Use 'i.myself' for grid tests (has test entries in database) - Use 'i.myself' for settings tests (stable database record) - Add required user parameter to /interpretation/entries endpoint The 'developer' user is auto-created on LDAP login with DEV type (only ROLE_USER), which lacks permissions for admin endpoints.
- Add FrozenClock implementing ClockInterface for fixed time in E2E tests - Add ClockFactory to create FrozenClock when APP_FROZEN_TIME env var is set - Update services.yaml to use ClockFactory for clock service - Add APP_FROZEN_TIME=2024-01-15 to E2E container in compose.yml
Replace new DateTime() with ClockInterface in getEntriesByUser() method to ensure deterministic date calculations in E2E tests.
Use EntrySaveDto's getDateAsDateTime(), getStartAsDateTime(), and getEndAsDateTime() methods for proper ISO 8601 date/time parsing instead of raw DateTime construction.
Clarify that Y-m-d is also ISO 8601 format (date-only), not a separate format. Both Y-m-d\TH:i:s (datetime) and Y-m-d (date-only) are valid ISO 8601 representations.
Replace CURDATE() with fixed date '2024-01-15' to ensure test entries are always visible in the grid when combined with frozen clock.
- Add clock.ts with installFrozenClock() using Playwright's clock API - Add date.ts with displayDateToIso() for API date format conversion - Export new helpers from index.ts
- Use installFrozenClock() for deterministic browser time - Convert API response dates from display format (d/m/Y) to ISO (Y-m-d) before sending to save API using displayDateToIso() helper - Run settings tests in serial mode to avoid parallel state conflicts
PHPSpreadsheet 1.x explicitly excluded PHP 8.5. Version 5.x supports ^8.1.
laminas-ldap 2.19.0 doesn't support PHP 8.5 yet (only ~8.1-8.4). The code works fine on PHP 8.5, it's just a constraint issue. Tracking: laminas/laminas-ldap#62 Also adds composer check-platform-reqs to CI for visibility.
- Add composer validate when composer.json/lock are staged - Add composer audit for security vulnerability detection - Replace check-platform-reqs with validate in CI (more useful) These checks ensure dependency integrity before commits reach CI.
Add the flag to both composer install commands in Dockerfile to work around laminas-ldap not yet supporting PHP 8.5. See: laminas/laminas-ldap#62
Doctrine ORM 3.x uses lazy ghost objects by default and no longer supports the auto_generate_proxy_classes configuration option.
- StatusPageAction: use Response::HTTP_OK constant - SaveEntryAction: use instanceof type checks - FrozenClock: make class readonly
CodeQL does not support PHP as a language for analysis. Only javascript-typescript is analyzed.
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
Major upgrade to PHP 8.5 and Symfony 8.0, including comprehensive test infrastructure improvements and E2E test determinism fixes.
Key Changes
FrozenClockandClockFactoryfor deterministic time-based testingCommits
Testing
Breaking Changes
Test plan
make testto verify all PHPUnit tests passmake cs-checkto verify code stylenpm run e2eto verify E2E tests passmake dev-up