Skip to content

feat: support Symfony 8.1+ runCommand via conditional class aliasing#676

Merged
alexisLefebvre merged 3 commits into
liip:masterfrom
alexisLefebvre:fix/symfony-8.1-run-command-compat
Jun 24, 2026
Merged

feat: support Symfony 8.1+ runCommand via conditional class aliasing#676
alexisLefebvre merged 3 commits into
liip:masterfrom
alexisLefebvre:fix/symfony-8.1-run-command-compat

Conversation

@alexisLefebvre

@alexisLefebvre alexisLefebvre commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

This PR adds compatibility with Symfony 8.1's new runCommand() method returning ExecutionResult.

Changes:

  • Created LegacyWebTestCase and ModernWebTestCase to declare correct version-specific signatures for runCommand().
  • Aliased them dynamically in WebTestCase using robust feature detection (method_exists()) to check if the parent class has runCommand().
  • Maintained compatibility with test case states (custom verbosity, inputs, decoration) using WebTestCase::$activeInstance tracking.
  • Updated the bundle's command test suite to handle both CommandTester and ExecutionResult transparently using direct instanceof checks.
  • Ran php-cs-fixer to clean up unused imports and apply styling fixes.

Fix issue from:


🤖 Generated with Antigravity (Gemini 3.5 Flash)

@alexisLefebvre alexisLefebvre force-pushed the fix/symfony-8.1-run-command-compat branch 3 times, most recently from 9b65a63 to dcf9092 Compare June 24, 2026 00:17
alexisLefebvre and others added 3 commits June 24, 2026 02:20
- Created LegacyWebTestCase and ModernWebTestCase to house version-compatible runCommand signatures.
- Configured dynamic class aliasing in WebTestCase based on Kernel::VERSION.
- Added active instance tracking to WebTestCase to support static context delegation.
- Updated command tests to support both CommandTester and ExecutionResult.

Co-authored-by: Gemini 3.5 Flash <218195315+gemini-cli@users.noreply.github.com>
- Checked Symfony version using Kernel::VERSION in test assertions rather than class_exists(ExecutionResult::class).
- Applied php-cs-fixer style fixes to WebTestCase.php.

Co-authored-by: Gemini 3.5 Flash <218195315+gemini-cli@users.noreply.github.com>
…rnel::VERSION check

Co-authored-by: Gemini 3.5 Flash <218195315+gemini-cli@users.noreply.github.com>
@alexisLefebvre alexisLefebvre force-pushed the fix/symfony-8.1-run-command-compat branch from dcf9092 to 10e3fab Compare June 24, 2026 00:20
@alexisLefebvre alexisLefebvre merged commit 59f9ca7 into liip:master Jun 24, 2026
23 checks passed
@alexisLefebvre alexisLefebvre deleted the fix/symfony-8.1-run-command-compat branch June 24, 2026 00:23
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