-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat(StatelessApplicationTest): Add test for rendering exceptions in debug mode with display errors enabled. #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…debug mode with display errors enabled.
WalkthroughA new test method was added to the Changes
Sequence Diagram(s)sequenceDiagram
participant Test as testRenderExceptionSetsDisplayErrorsInDebugMode
participant PHP as PHP Runtime
participant App as StatelessApplication
participant Handler as ErrorHandler
participant Response as HTTP Response
Test->>PHP: Redefine YII_ENV_TEST, set SAPI, globals
Test->>App: Instantiate with error handler (debug mode)
App->>Handler: Handle request (site/trigger-exception)
Handler->>PHP: Set display_errors=1
Handler->>Response: Render exception details (status 500)
Test->>PHP: Assert display_errors=1
Test->>Response: Assert status 500 and exception message
Test->>PHP: Restore display_errors and YII_ENV_TEST
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Possibly related PRs
Suggested labels
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (5)📓 Common learnings📚 Learning: in yii2-extensions/psr-bridge, the statelessapplication creates a new response instance for each req...Applied to files:
📚 Learning: in yii2-extensions/psr-bridge, the statelessapplication creates a new response instance for each req...Applied to files:
📚 Learning: in the yii2-extensions/psr-bridge project, the base testcase class already handles $_server cleanup ...Applied to files:
📚 Learning: in the yii2-extensions/psr-bridge project, the base testcase class already handles $_server cleanup ...Applied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61 +/- ##
============================================
+ Coverage 99.46% 99.86% +0.40%
Complexity 292 292
============================================
Files 12 12
Lines 746 746
============================================
+ Hits 742 745 +3
+ Misses 4 1 -3 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit