You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I'm developing with php 7.4, for CLI and Apache I have set error_reporting to E_ALL, php errors during rendering of phtml
Current behavior
The deprecation notice inside whateverAction is raising exception and fails test as expected.
The deprecation notice inside whatever.phtml file rendering an exception visible in browser but it passes the test. The visible error in browser is Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /path/to/whatever.phtml on line xy
How to reproduce
Use php 7.4
Set up error_reporting for CLI to E_ALL in php.ini
Use current PHPUnit (version shouldn't matter, I'm using 9.4.1) and use default configuration with convertDeprecationsToExceptions set to true
Use following piece of code in any action and the corresponding phtml file:
if (array_key_exists('test', new \ArrayObject())) {
//Thistriggersdeprecatederror
}
Expected behavior
While testing with this configuration the rendering of a phtml file should obey the same rules as the normal php files.
The text was updated successfully, but these errors were encountered:
That is expected outcome depending on how your test is setup. View rendering happens after main dispatch event and outside of the controller.
Generally, any exception in view script would be intercepted and passed to render.error (MvcEvent::EVENT_RENDER_ERROR) event. Unless exception happens while already inside render.error event, at which point it will be allowed to bubble all the way up and kill the application with the unhandled exception error.
This package does not provide testing facilities, so this looks to be either a support question or a laminas-test issue.
Bug Report
Summary
Currently I'm developing with php 7.4, for CLI and Apache I have set error_reporting to E_ALL, php errors during rendering of phtml
Current behavior
The deprecation notice inside whateverAction is raising exception and fails test as expected.
The deprecation notice inside whatever.phtml file rendering an exception visible in browser but it passes the test. The visible error in browser is
Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /path/to/whatever.phtml on line xy
How to reproduce
convertDeprecationsToExceptions
set totrue
Expected behavior
While testing with this configuration the rendering of a phtml file should obey the same rules as the normal php files.
The text was updated successfully, but these errors were encountered: