Preparations
- in IDE:
- open the modules/custom/units/widgets/widget_eh.php file for editing
- in the \WidgetEventHandler::SetCustomQuery method after calling the parent method add $b = $a + 1;
- save changes
Part 1 (install/upgrade)
NOTE: Repeat this test also for an upgrade.
- perform a clean install
- login to the Admin Console
- go to the Configuration → Website → Adanced section
- confirm, that the Record code fragments in "System Log" for these paths (regexp) system setting is present and has #(modules/custom|system/cache/modules/custom)/.*# value
- go to the Configuration → Website → Scheduled Tasks
- confirm, that a rotate_system_log_code_fragments was added
- go to phpMyAdmin
- confirm, that TIMESTAMP_CODE_FRAGMENTS_ROTATED index for the SystemLog table is present
Part 2 (code fragment logging, filtering, display, rotation)
NOTE: Repeat this test with different (see below) system setting values.
- login to the Admin Console
- go to the Configuration → Website → Adanced section
- set the Record code fragments in "System Log" for these paths (regexp) system setting to (choose value based on test iteration):
- #(modules/custom|system/cache/modules/custom)/.*#
- #(core|system/cache/core)/.*#
- (empty string)
- save changes
- go to the Custom → Widgets section
- confirm, that an Undefined variable: a notice appears in Debugger
- go to the Logs & Reports → System Log section
- confirm, that record for the Undefined variable: a notice was created
- open the record for the Undefined variable: a notice for viewing/editing
- testing source line toggle code
- confirm, that the Toggle Code... link is shown at the end of the Source Filename: line value when a source file matches used filtering regexp
- click on the Toggle Code... link once
- confirm, that:
- a highlighted code fragment appears
- each line in the code fragment has a line number, that corresponds to the line number in the associated file
- line number associated with the trace is marked with the >>> sign
- testing backtrace
- confirm, that the backtrace looks visually the same as in other system log records
- click on the ALL Function: links of the backtrace records
- confirm, that:
- the Arguments: text is shown above function/method arguments
- the Toggle Code... link is shown below function/method arguments in the lines related to:
- the Custom module files (e.g. PHP files from "modules/custom/units" or TPL file from the "modules/custom/admin_templates", that were compiled into PHP files), when the system setting was #(modules/custom|system/cache/modules/custom)/.*#
- the Core module files (e.g. PHP files from "core/*" or TPL file from the "core/admin_templates", that were compiled into PHP files), when the system setting was #(core|system/cache/core)/.*#
- the Core and Custom module files, when the system setting was (empty string)
- click on the Toggle Code... link once
- confirm, that:
- a highlighted code fragment appears
- each line in the code fragment has a line number, that corresponds to the line number in the associated file
- line number associated with the trace is marked with the >>> sign
- testing rotation
- execute the rotate_system_log_code_fragments scheduled task
- confirm, that system log records, created during tests, have retained their code fragments
- change the LogTimestamp of a system log record, that has code fragments to a 1672524000 (1 Jan 2023)
- execute the rotate_system_log_code_fragments scheduled task
- confirm, that above changed system log record doesn't contain any code fragments (source & backtrace)