test: integrate ttt for PHPUnit test sandboxing - #100
Conversation
Install konradmichalik/ttt and register its PHPUnit extension in the unit config. Replace hand-rolled $GLOBALS['TYPO3_CONF_VARS'] setUp/tearDown juggling with declarative #[WithTypo3ConfVars] attributes, giving a guaranteed restore regardless of test outcome and fixing several leaks that had no cleanup at all.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughTests now use ChangesTest configuration migration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.2.6)Composer install failed: this project depends on private packages that require authentication (e.g. GitLab/GitHub, Laravel Nova, etc.). Instead, run PHPStan in a CI/CD pipeline where you can use custom packages — our pipeline remediation tool can use the PHPStan output from your CI/CD pipeline. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
# Conflicts: # composer.lock
Summary
konradmichalik/ttt(TYPO3 Testing Terrarium) as the unit-test sandbox, replacing hand-writtenTYPO3_CONF_VARSbackup/restore boilerplate with declarative#[WithTypo3ConfVars]attributes (guaranteed restore, even on hard failures).TYPO3_CONF_VARSjuggling to attributes, incidentally fixing several pre-existing state leaks (tests that mutated config without cleanup).Changes
composer.json/composer.lock- addkonradmichalik/ttt: ^0.2.0as a dev dependency.phpunit.xml- register<bootstrap class="KonradMichalik\Ttt\TttExtension"/>in the unit test config.Tests/Unit/**(8 files) - migrateTYPO3_CONF_VARSsetUp/tearDownand inline set/unset to#[WithTypo3ConfVars]class/method attributes; delete redundanttearDowncleanup; keep non-ttt state ($_SERVER['REMOTE_ADDR']) as-is.Notes
Summary by CodeRabbit